mancj / MaterialSearchBar

Material Design Search Bar for Android
Other
2.03k stars 332 forks source link

Solving on Menu Item click #150

Open Allosh87 opened 3 years ago

Allosh87 commented 3 years ago

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;

} `