Boolean onMenu ItemClick MenuItem item

//do your thing return true;

MyResponse myResponse = new MyResponse(...); menuItem.setOnMenuItemClickListener(myResponse);

The onMenuItemClick method is called when the menu item has been invoked. This code executes right when the menu item is clicked, even before the onOptionsItemSelected method is called. If onMenuItemClick returns true, no other callbacks will be executed—including the onOptionsItemSelected callback method. This means that the listener code takes precedence over the onOptionsItemSelected method.

0 0

Post a comment