【问题标题】:How to search an item from listview ? i have items in listview from Server URL如何从列表视图中搜索项目?我有来自服务器 URL 的列表视图中的项目
【发布时间】:2015-04-06 14:10:57
【问题描述】:

我正在使用这个addTextListener,在edittext 上使用onclicking 之后,它没有搜索。请帮帮我。

editText.addTextChangedListener(new TextWatcher() {

            @Override
            public void onTextChanged(CharSequence s, int start, int before,
                    int count) {



            }

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

            }

            @Override
            public void afterTextChanged(Editable s) {
                if (0 != editText.getText().length()) {
                    String spnId = editText.getText().toString();
                    setSearchResult(spnId);
                } else {
                    setData();
                }
            }
        });

        setData();

}

【问题讨论】:

    标签: android listview search android-listview


    【解决方案1】:

    查看此内容以显示来自搜索文本的过滤数据:http://www.androidhive.info/2012/09/android-adding-search-functionality-to-listview/ - 适合我

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-14
      • 2012-11-10
      • 2023-03-26
      • 1970-01-01
      • 2021-03-15
      • 1970-01-01
      • 2012-03-28
      • 1970-01-01
      相关资源
      最近更新 更多