Android 用于筛选适配器的快速搜索框
现在我有一个列表活动,由游标适配器提供动力。 我有一个AutoCompleteTextView,允许用户过滤列表。 代码如下所示:Android 用于筛选适配器的快速搜索框,android,search,filter,Android,Search,Filter,现在我有一个列表活动,由游标适配器提供动力。 我有一个AutoCompleteTextView,允许用户过滤列表。 代码如下所示: filterText = (AutoCompleteTextView) findViewById(R.id.search_box); filterText.setAdapter(mAdapter); filterText.setDropDownHeight(0); // hide the drop down, just filter the listActivity
filterText = (AutoCompleteTextView) findViewById(R.id.search_box);
filterText.setAdapter(mAdapter);
filterText.setDropDownHeight(0); // hide the drop down, just filter the listActivity
filterText.setThreshold(1);
它工作得很好。我想切换到快速搜索框,这样我就不会占用太多屏幕空间,我觉得快速搜索框更符合用户界面标准。
问题是快速搜索框并不能很好地过滤列表。它不会在键入的每封信上都广播意图(仅当您单击“搜索”按钮时)。有没有关于如何在某个地方执行此操作的好教程?我决定继续使用筛选文本,现在担心快速搜索框。
android:windowSoftInputMode=“stateHidden”
在做出决定时非常有帮助