コード例 #1
0
 public MenuItem setActionView(View view) {
   mActionView = view;
   mActionProvider = null;
   if (view != null && view.getId() == View.NO_ID && mId > 0) {
     view.setId(mId);
   }
   mMenu.onItemActionRequestChanged(this);
   return this;
 }
コード例 #2
0
  public void setShowAsAction(int actionEnum) {
    switch (actionEnum & SHOW_AS_ACTION_MASK) {
      case SHOW_AS_ACTION_ALWAYS:
      case SHOW_AS_ACTION_IF_ROOM:
      case SHOW_AS_ACTION_NEVER:
        // Looks good!
        break;

      default:
        // Mutually exclusive options selected!
        throw new IllegalArgumentException(
            "SHOW_AS_ACTION_ALWAYS, SHOW_AS_ACTION_IF_ROOM,"
                + " and SHOW_AS_ACTION_NEVER are mutually exclusive.");
    }
    mShowAsAction = actionEnum;
    mMenu.onItemActionRequestChanged(this);
  }
コード例 #3
0
 public void actionFormatChanged() {
   mMenu.onItemActionRequestChanged(this);
 }