The adapter that I have in the autoCompleteTextView is something like this:
- -apple -pear -orange -banana -grape
The way it's working now if I type "p", in the dropDown list will appear apple, pear and grape because they make a match but I just want it to show pear because is the only word which starts with p. So, the question is: How can I tell the autoComplete's dropDownList to show matches with the words that start with what I'm searching on and not show words that contains it in some other position that is not the first. For example, if I type "pe" I want to show only pear and not grape because pear starts with that string. This is my code
ArrayList<String> data = dbHelper.getDataAsString();
ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, data);
autoCompleteTv.setAdapter(adapter);
autoCompleteTv.setThreshold(2);