I have some code that sets a boolean if the search view is open or not.
MenuItemCompat.setOnActionExpandListener(action_search, new MenuItemCompat.OnActionExpandListener() {
@Override
public boolean onMenuItemActionExpand(MenuItem item){
isSearch = true;
return true;
}
@Override
public boolean onMenuItemActionCollapse(MenuItem item){
isSearch = false;
return true;
}
});
It works. I'm happy with the way it responds. However, it it shows as deprecated, the setOnActionExpandListener is crossed out with the warning
android.support.v4.view.MenuItemCompat.setOnActionExpandListener is deprecated
Suggestions?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…