Android SearchView empty string

前端 未结 2 731
别跟我提以往
别跟我提以往 2021-02-06 12:26

I\'m trying to use a SearchView and I got everything to work, except when I want to search an empty string.
The onQueryTextChange does react when I remove the last character

2条回答
  •  没有蜡笔的小新
    2021-02-06 12:54

    Perhaps it's not suited for your app but you also have the option to use a simple EditText, then add a TextWatcher listener. This way you catch every input even if the user enters an empty string.

提交回复
热议问题