AutoCompleteTextView hints in landscape mode

和自甴很熟 提交于 2019-12-04 08:36:36

I just encountered this issue myself. Like you said, in landscape the TextView is basing its autocomplete hints on the result of getItem(). I don't really see a way to provide anything other than text in this scenario, but a simple solution to get the correct text to show in landscape is to override toString() for the object you are basing the hint on.

For instance, in my scenario I am using a list of Contact objects to populate my autocomplete hints, so I overrode toString() in my Contact class to get it to show "FirstName LastName" instead of a raw object representation like "Contact@a2a6d4d3a5."

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!