搜索框(SearchView)的功能與用法

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輸入漢字拼音首字母實現過濾提示(支持多音字):微信

http://m.baidu.com/from=879a/bd_page_type=1/ssid=0/uid=0/pu=usm%400%2Csz%401320_1001%2Cta%40iphone_2_4.4_3_534/baiduid=5FDA02917A51D8981550A81E22A5E5AB/w=0_10_%E5%8C%B9%E9%85%8D%E4%B8%AD%E6%96%87%E9%A6%96%E5%AD%97%E6%AF%8D/t=iphone/l=3/tc?ref=www_iphone&lid=4466771100200288344&order=10&vit=osres&tj=www_normal_10_0_10&m=8&srd=1&cltj=cloud_title&dict=30&sec=41955&di=3a029c35c4e646e7&bdenc=1&nsrc=IlPT2AEptyoA_yixCFOxXnANedT62v3IEQGG_8xXBjX5nk_qva02GtAfEFWhACbIU-3wdoTPshc2xnG-RyJrlK&qq-pf-to=pcqq.groupiphone

 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

相關文章
相關標籤/搜索