Searchview's Onclose Listener Never Runs
Got a SearchView (androidx, not support lib) I have added its proper listeners like: @Override public boolean onQueryTextSubmit(String query) { Toaster.show(this, 'onQue
Solution 1:
Ended up:
ViewsearchViewsCloseBtn= searchView.findViewById(R.id.search_close_btn);
searchViewsCloseBtn.setOnClickListener(newView.OnClickListener() {
@OverridepublicvoidonClick(View v) {
Toaster.show(myContext, "I hate this platform.");
}
});
"R.id.search_close_btn"
is the actual reference to the SearchView's close btn.
If you manually set an onClickListener it works.
Post a Comment for "Searchview's Onclose Listener Never Runs"