edittext实现自动查询,刷新listview
生活随笔
收集整理的這篇文章主要介紹了
edittext实现自动查询,刷新listview
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
mEdittextqueryvalue.addTextChangedListener(new TextWatcher() {
?? ??? ??? ?@Override
?? ??? ??? ?public void onTextChanged(CharSequence s, int start, int before,
?? ??? ??? ??? ??? ?int count) {
?? ??? ??? ??? ?/** 從本地數據庫查詢 */
?? ??? ??? ??? ?query = s.toString(); //s是edittext編輯的內容
?? ??? ??? ??? ?isadd=false;
?? ??? ??? ??? ?pageindex=0;
?? ??? ??? ??? ?refreshView(type, query,pagesize,pageindex);
?? ??? ??? ?}
?? ??? ??? ?@Override
?? ??? ??? ?public void beforeTextChanged(CharSequence s, int start, int count,
?? ??? ??? ??? ??? ?int after) {
?? ??? ??? ?}
?? ??? ??? ?@Override
?? ??? ??? ?public void afterTextChanged(Editable s) {
?? ??? ??? ?}
?? ??? ?});
?? ??? ??? ?@Override
?? ??? ??? ?public void onTextChanged(CharSequence s, int start, int before,
?? ??? ??? ??? ??? ?int count) {
?? ??? ??? ??? ?/** 從本地數據庫查詢 */
?? ??? ??? ??? ?query = s.toString(); //s是edittext編輯的內容
?? ??? ??? ??? ?isadd=false;
?? ??? ??? ??? ?pageindex=0;
?? ??? ??? ??? ?refreshView(type, query,pagesize,pageindex);
?? ??? ??? ?}
?? ??? ??? ?@Override
?? ??? ??? ?public void beforeTextChanged(CharSequence s, int start, int count,
?? ??? ??? ??? ??? ?int after) {
?? ??? ??? ?}
?? ??? ??? ?@Override
?? ??? ??? ?public void afterTextChanged(Editable s) {
?? ??? ??? ?}
?? ??? ?});
轉載于:https://www.cnblogs.com/melons/p/5791937.html
總結
以上是生活随笔為你收集整理的edittext实现自动查询,刷新listview的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 感觉又学到了不少,在这里写下来,但也有一
- 下一篇: zoj 2526(一道很好的最短路应用题