通过改写ArrayAdapter 用AutoCompleteTextView 实现汉字和拼音双向关联
2010-07-15 20:43:00 来源:WEB开发网核心提示:@Overrideprotected void publishResults(CharSequence constraint, FilterResults results) {mObjects = (List) results.values;if (results.count > 0) {notifyDataSe
@Override
protected void publishResults(CharSequence constraint, FilterResults results) {
mObjects = (List
if (results.count > 0) {
notifyDataSetChanged();
} else {
notifyDataSetInvalidated();
}
}
}
}
复制代码
调用代码如下:
cAdapter = new
CityAdapter
autoView.setAdapter(cAdapter);
autoView.setThreshold(1);
//其中 autoView 为 AutoCompleteTextView
Tags:通过 改写 ArrayAdapter
编辑录入:coldstar [复制链接] [打 印]更多精彩
赞助商链接