与搜索功能的Android列表视图 [英] Android list view with search functionality
问题描述
我的动态列表视图(从web服务填充)具有AutoCompleteTextView,搜索按钮。
My dynamic list view(populated from a webservice) has a AutoCompleteTextView, "Search" button.
我已经实现自动完成功能,它工作正常;当我键入分钟2chars的AutoCompleteTextView正在显示匹配的结果,当我选择从人口稠密的列表中的项目,它会自动在AutoCompleteTextView出现。
I have implemented auto complete functionality for AutoCompleteTextView, it is working properly; when i type min 2chars, the AutoCompleteTextView is displaying matching results and when i select an item from the populated list, it is automatically appearing in the AutoCompleteTextView.
这是好的,现在我需要实施上述行动对我的搜索按钮,当我点击这个按钮,主列表视图应显示匹配的结果而已。
That is fine, now I need to implement action for my "Search" button, when I click on this button, the main list view should display the matched results only.
什么是做的最好的方式,而不会再次调用web服务?
What is the best way to do it, without calling the webservice again?
在此先感谢。
-nehatha
Thanks in advance. -nehatha
推荐答案
最好的Andr oid办法做到这一点是使用的快速搜索框。基本上你实现一个供应商在游标中返回的搜索结果。该光标将被用作源来显示的项目的列表。您可以自定义当用户单击该项目要完成的动作。
Best Android way to do it is to use the Quick Search Box. Basically you implement a provider to return the search results in a cursor. That cursor will be used as the source to show a list of items. And you can customize the action to be done when the user clicks on the item.
这篇关于与搜索功能的Android列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!