searchbar.inflateMenu(R.menu.menu_main); searchbar.getMenu().setOnMenuItemClickListener(this);
Then implement PopupMenu.OnMenuItemClickListener
Finally:
`
@Override
public boolean onMenuItemClick ( MenuItem item )
{
int id = item.getItemId ( );
switch ( id )
{
case R.id.menu_theme:
ThemeUtils.setAppTheme( this );
break;
case R.id.menu_settings:
NavigationUtils.openActivity (this , SettingsActivity.class);
break;
}
return true;
searchbar.inflateMenu(R.menu.menu_main);
searchbar.getMenu().setOnMenuItemClickListener(this);
Then implementPopupMenu.OnMenuItemClickListener
Finally:` @Override public boolean onMenuItemClick ( MenuItem item ) { int id = item.getItemId ( ); switch ( id ) { case R.id.menu_theme: ThemeUtils.setAppTheme( this ); break;
} `