Android: AutoCompleteTextView - how to customize sort order
The normal way how AutoCompleteTextView
shows suggestions, is that it shows only strings that begin with the text the user entered, but the sort order of the results is undefined.
Can I somehow sort them by myself?
So that when user enters e.g. "g", I show him results beginning w开发者_运维问答ith "g" that are most relevant for him.
I suspect that if you implement a custom Filter
and return it as part of your ListAdapter & Filterable
implementation that you hand to the AutoCompleteTextView
, that you can achieve your goal that way, but I have not tried this.
精彩评论