I want to show some default suggestions in SearchView when User hasn\'t typed anything. I am setting my custom suggestion adapter manually using matrix cursor. I tried setting
the questioner wants to know how to know when the searchview is expanded. just do this with your searchview (assuming its standalone but you can get a reference to it from menu item if needed):
searchView.setOnSearchClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//search is expanded
}
});
here is for closed situation:
searchView.setOnCloseListener(new SearchView.OnCloseListener() {
@Override
public boolean onClose() {
// searchview closed
return false;
}
});