如何获取AutoCompleteTextView中匹配项的计数? [英] How to get count of matching items in AutoCompleteTextView?
本文介绍了如何获取AutoCompleteTextView中匹配项的计数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试获取AutoCompleteTextView
中匹配项的计数,或检查是否至少有一个匹配项.我该怎么办?
I'm trying to get count of matching items in AutoCompleteTextView
, or checking to see if there is at least one matching item. How do I do this?
推荐答案
您可以创建自己的自定义视图并覆盖onFilterComplete
.
You can create you own custom view and override onFilterComplete
.
public class MAutoCompleteTextView extends AutoCompleteTextView {
@Override
public void onFilterComplete(int i) {
Log.i(TAG, "count of matching items: "+ i);
}
// Override the constructors
}
这篇关于如何获取AutoCompleteTextView中匹配项的计数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文