I have this code on my activity:
ParseQuery<ParseUser> query = ParseUser.getQuery();
query.findInBackground(new FindCallback<ParseUser>() {
public void done(List<ParseUser> userList, ParseException e) {
if (e == null) {
Log.d("score", "Retrieved " + userList.size() + " scores");
friends = new ArrayList<String>();
for (int i = 0; i < userList.size(); i++) {
friends.add(userList.get(i).getUsername().toString());
}
aAdapter = new ArrayAdapter<String>(context, android.R.layout.simple_dropdown_item_1line, friends);
friendChooser.setInputType(InputType.TYPE_CLASS_TEXT);
friendChooser.setAdapter(aAdapter);
} else {
Log.d("score", "Error: " + e.getMessage());
}
}
});
aAdapter is an ArrayAdapter.
friendChooser is a MultiAutoCompleteTextView.
friends is a List.
userList is a List.
I'm trying to get an ArrayAdapter<String>
of my Parse.com user's names and apply it on the MultiAutoCompleteTextView, The problem is that I don't get any results on the MultiAutoCompleteTextView. How can I solve this problem?
I don't have much experience with MultiAutoCompleteTextView
s, but according to this tutorial you need to add this lines before setting the adapter:
friendChooser.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
friendChooser.setInputType(InputType.TYPE_CLASS_TEXT);
friendChooser.setThreshold(1);
and then call:
friendChooser.setAdapter(aAdapter);
It worked for me