@Override
  public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    menu.add(0, PLAY_SELECTION, 0, getResources().getString(R.string.play_all));
    menu.add(0, ADD_TO_PLAYLIST, 0, getResources().getString(R.string.add_to_playlist));
    menu.add(0, USE_AS_RINGTONE, 0, getResources().getString(R.string.use_as_ringtone));
    if (mEditMode) {
      menu.add(0, REMOVE, 0, R.string.remove);
    }
    menu.add(0, SEARCH, 0, getResources().getString(R.string.search));

    AdapterContextMenuInfo mi = (AdapterContextMenuInfo) menuInfo;
    mSelectedPosition = mi.position;
    mCursor.moveToPosition(mSelectedPosition);

    try {
      mSelectedId = mCursor.getLong(mMediaIdIndex);
    } catch (IllegalArgumentException ex) {
      mSelectedId = mi.id;
    }

    String title = mCursor.getString(mTitleIndex);
    menu.setHeaderTitle(title);
    super.onCreateContextMenu(menu, v, menuInfo);
  }