unable to search using custom Array Adapter in Android?

前端 未结 2 1470
礼貌的吻别
礼貌的吻别 2021-01-29 06:48

I am unable to search from listview, i tried various ways, but its not working for me(No Errors). I have other way to search but i want to make this way possible.

2条回答
  •  孤街浪徒
    2021-01-29 07:41

    1) Call mListview.setTextFilterEnabled(true); on the ListView to enable filtering

    2) Create a relevant constructor for your CustomAdapter class. You'll need to pass it context as well as various resources/data. Read up on it: http://developer.android.com/reference/android/widget/ArrayAdapter.html

    OR

    Use a TextWatcher linked here.

提交回复
热议问题