Code example for MenuItem

Methods: getItemId

0
    return(super.onCreateOptionsMenu(menu));
  } 
 
  @Override 
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case EDIT_ID:
        startActivity(new Intent(this, EditPreferences.class));
        return(true); 
    } 
 
    return(super.onOptionsItemSelected(item));
  } 
}