I have a Json arraylist. Here already set the adapter file with this Autocomplete text view.
From my code:
I have used a wrapper class like USER. In this class 3 fields are there (userid, username and designation)
.
here i need to write some text means need to show the suggestions from username and designation.if the typing word matches from any of these two fields suggestions need to display.
How can i do with the AutoCompleteTextView
.
ArrayAdapter<User> userAdapter = new ArrayAdapter<>(getActivity(), R.layout
.spinner_item_text,
UserList);
Now the suggestions showing in the array. But i need to show the suggestion like string.
For EG :
UserList having the values like
{
"profile_view": [
{
username :"test",designation:"SE"
},
{
username :"test1",designation:"TE"
}]}
now am typing the keyword in the box like "t" means need to give the suggestions like
test
test1
TE
How can i do ? Please give me any ideas to implement this?