zoukankan      html  css  js  c++  java
  • 编辑框内容变化,修改列表

    此时不会用到autocomplete编辑,而是为EditText添加addTextChangedListener事件

    //搜索框
    searchText.addTextChangedListener(new TextWatcher() {
    String urlStr = "r=game/getList&lang=" + APP_LANGUAGE;

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {
    serachKeyWord = searchText.getText().toString();
    if( listFlag == "game" ){
    urlStr = "r=game/getList&lang=" + APP_LANGUAGE + "&access_token=" + access_token + "&pid=" + pid;
    if( serachKeyWord != null || serachKeyWord.equals("") == false ){
    urlStr = urlStr + "&keyword=" + serachKeyWord;
    }
    getGameListData(urlStr, httpPort);
    }else if( listFlag == "card" ){
    urlStr = "r=card-category/getList&lang=" + APP_LANGUAGE + "&access_token=" + access_token + "&pid=" + pid;
    if( serachKeyWord != null || serachKeyWord.equals("") == false ){
    urlStr = urlStr + "&keyword=" + serachKeyWord;
    }
    getCardListData(urlStr, httpPort);
    }
    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count,
    int after) {

    }

    @Override
    public void afterTextChanged(Editable s) {

    }
    });

  • 相关阅读:
    iOS8中用UIVisualEffectView实现高斯模糊视图(毛玻璃效果)
    IOS推荐学习网站
    Xcode因为证书问题经常报的那些错
    bug集合令
    html5的标签
    CSS小总结
    JS中的闭包
    前端之路宣告式
    linux安装mysql数据库
    yarn环境搭建
  • 原文地址:https://www.cnblogs.com/xingmeng/p/2479255.html
Copyright © 2011-2022 走看看