开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜