Android: Using item selected in AutoCompleteTextView to populate another field

前端 未结 2 2083
半阙折子戏
半阙折子戏 2021-02-10 01:47

I am trying to build an app where the names of employees are stored in a table. On a particular page, the user can enter the name of an employee in an autocompletetextview and s

2条回答
  •  攒了一身酷
    2021-02-10 02:52

    I found the problem.... It was because of the missing piece of code in the performFiltering method... When the constraint (or prefix) using which the list has to be filtered is null we just need to return the entire list back.... Once this was added in the else for the null check for constraint the filtering works like golden....

                ArrayList  list = new ArrayList (orig);
                results.values = list;
                results.count = list.size();
    

提交回复
热议问题