1.http://www.cnblogs.com/wolipengbo/p/3392347.htmlphp
2.利用Java開源庫把漢字轉拼音:html
http://tuoxie007.iteye.com/blog/392240android
使用方法:git
http://www.oschina.net/question/54100_27489github
3.AutoCompleteTextView輸入漢字拼音首字母實現過濾提示(支持多音字):微信
android之仿微信的listview過濾功能 ide
http://bbs.51cto.com/thread-973194-1.htmlui
關鍵代碼:this
String data[] = { "MOTO", "HTC", "Samsung",
"iphone","Nokia","HUAWEI" };
adapter = new ArrayAdapter<String>(this, R.layout.item, R.id.item_name,
data);
listView.setAdapter(adapter);
searchEt.addTextChangedListener(new TextWatcher() {
//當輸入框的文字改變時,執行如下方法。
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
adapter.getFilter().filter(s); //適用於非自定義adapter
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
@Override
public void afterTextChanged(Editable s) {
}
});
}
http://www.apkbus.com/forum.php?mod=viewthread&tid=93041 麻煩,適用於自定義adapter
https://github.com/Mr7Cat/Android-Search-ListView-using-Filter 經典,簡單,適用於自定義adapter