Answer the question
In order to leave comments, you need to log in
How to track a click on the search view icon?
I use search view from android.widget library
final SearchView searchView = findViewById(R.id.search_view);
searchView.setOnCloseListener(new SearchView.OnCloseListener() {
@Override
public boolean onClose() {
Message.showMessage(searchView.getContext(),"test");
return false;
}
});
Answer the question
In order to leave comments, you need to log in
I found a solution for myself, maybe it will be useful for someone
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(final String query) {
//вызовется при нажатии на лупу на клавиатуре
return false;
}
@Override
public boolean onQueryTextChange(final String newText) {
//вызовется при изменении ведённого текста
return true;
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question