Code example for MenuItem

Methods: getItemId

0
    return(super.onCreateOptionsMenu(menu));
  } 
 
  @Override 
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case android.R.id.home:
        finish(); 
 
        return(true); 
    } 
 
    return(super.onOptionsItemSelected(item));
  } 
 
  private void removeFragments(FragmentManager fragMgr,
                               FragmentTransaction xaction) {
    ItemsFragment items=
        (ItemsFragment)fragMgr.findFragmentById(R.id.second_pane);
 
    if (items != null) {