/**
   * Invokes the item by calling various listeners or callbacks.
   *
   * @return true if the invocation was handled, false otherwise
   */
  public boolean invoke() {
    if (mClickListener != null && mClickListener.onMenuItemClick(this)) {
      return true;
    }

    if (mMenu.dispatchMenuItemSelected(mMenu.getRootMenu(), this)) {
      return true;
    }

    if (mItemCallback != null) {
      mItemCallback.run();
      return true;
    }

    if (mIntent != null) {
      try {
        mMenu.getContext().startActivity(mIntent);
        return true;
      } catch (ActivityNotFoundException e) {
        Log.e(TAG, "Can't find activity to handle intent; ignoring", e);
      }
    }

    if (mActionProvider != null && mActionProvider.onPerformDefaultAction()) {
      return true;
    }

    return false;
  }