Code example for MenuItem

Methods: getItemId, getMenuInfo

0
        .setAlphabeticShortcut('d'); 
  } 
 
  @Override 
  public boolean onContextItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case DELETE_ID:
        AdapterView.AdapterContextMenuInfo info=
          (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();
 
        delete(info.id);
        return(true); 
    } 
 
    return(super.onOptionsItemSelected(item));
  } 
 
  public Loader<Cursor> onCreateLoader(int loaderId, Bundle args) {
    return(new CursorLoader(this, Provider.Constants.CONTENT_URI,
                            PROJECTION, null, null, null));
  }