【发布时间】:2011-12-30 20:13:01
【问题描述】:
我有一个适配器,并且我使用 ad.getFilter().filter(s); 过滤列表视图。
如果我在 EditText 中写一个单词,效果会很好。
如果在一个单词后写一个空格字符,它将不起作用(结果没有行)。
例如,我想做一个带有名字和姓氏的过滤器。
我想在edittext中插入"Mario Rossi"并得到结果..
我希望我能解释一下。
非常感谢。
private TextWatcher filterTextWatcher = new TextWatcher() {
public void afterTextChanged(Editable s) {
}
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
public void onTextChanged(CharSequence s, int start, int before,
int count) {
ad.getFilter().filter(s);
}
};
【问题讨论】:
标签: android listview filter adapter