Skip to content

Instantly share code, notes, and snippets.

@luboganev
Created January 29, 2014 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luboganev/8687562 to your computer and use it in GitHub Desktop.
Save luboganev/8687562 to your computer and use it in GitHub Desktop.
Android Search compat action item collapse/expand
MenuItemCompat.setOnActionExpandListener(search, new MenuItemCompat.OnActionExpandListener() {
@Override
public boolean onMenuItemActionExpand(MenuItem menuItem) {
Toast.makeText(getApplicationContext(), "Expand", Toast.LENGTH_SHORT).show();
return true;
}
@Override
public boolean onMenuItemActionCollapse(MenuItem menuItem) {
Toast.makeText(getApplicationContext(), "Collapse", Toast.LENGTH_SHORT).show();
return true;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment