@Override
  protected boolean onCreateActionBar(Menu menu) {
    Activity activity = mActivity;
    final boolean inAlbum = mActivity.getStateManager().hasStateClass(AlbumPage.class);
    MenuInflater inflater = getSupportMenuInflater();

    if (mGetContent) {
      inflater.inflate(R.menu.pickup, menu);
      int typeBits = mData.getInt(GalleryActivity.KEY_TYPE_BITS, DataManager.INCLUDE_IMAGE);
      mActionBar.setTitle(GalleryUtils.getSelectionModePrompt(typeBits));
    } else if (mGetAlbum) {
      inflater.inflate(R.menu.pickup, menu);
      mActionBar.setTitle(R.string.select_album);
    } else {
      inflater.inflate(R.menu.albumset, menu);
      boolean wasShowingClusterMenu = mShowClusterMenu;
      mShowClusterMenu = !inAlbum;
      if (mShowClusterMenu != wasShowingClusterMenu) {
        if (mShowClusterMenu) {
          mActionBar.enableClusterMenu(mSelectedAction, this);
        } else {
          mActionBar.disableClusterMenu(true);
        }
      }
      boolean selectAlbums =
          !inAlbum && mActionBar.getClusterTypeAction() == FilterUtils.CLUSTER_BY_ALBUM;
      MenuItem selectItem = menu.findItem(R.id.action_select);
      selectItem.setTitle(
          activity.getString(selectAlbums ? R.string.select_album : R.string.select_group));

      MenuItem cameraItem = menu.findItem(R.id.action_camera);
      cameraItem.setVisible(GalleryUtils.isCameraAvailable(activity));

      FilterUtils.setupMenuItems(mActionBar, mMediaSet.getPath(), false);

      Intent helpIntent = HelpUtils.getHelpIntent(activity);

      MenuItem helpItem = menu.findItem(R.id.action_general_help);
      helpItem.setVisible(helpIntent != null);
      if (helpIntent != null) helpItem.setIntent(helpIntent);

      MenuItem moreItem = menu.findItem(R.id.action_more_image);
      moreItem.setVisible(mActivity.getResources().getBoolean(R.bool.config_show_more_images));

      mActionBar.setTitle(mTitle);
      mActionBar.setSubtitle(mSubtitle);
    }
    return true;
  }
  @Override
  protected boolean onCreateActionBar(Menu menu) {
    GalleryActionBar actionBar = mActivity.getGalleryActionBar();
    MenuInflater inflator = getSupportMenuInflater();
    if (mGetContent) {
      inflator.inflate(R.menu.pickup, menu);
      int typeBits = mData.getInt(GalleryActivity.KEY_TYPE_BITS, DataManager.INCLUDE_IMAGE);
      actionBar.setTitle(GalleryUtils.getSelectionModePrompt(typeBits));
    } else {
      inflator.inflate(R.menu.album, menu);
      actionBar.setTitle(mMediaSet.getName());

      FilterUtils.setupMenuItems(actionBar, mMediaSetPath, true);

      menu.findItem(R.id.action_group_by).setVisible(mShowClusterMenu);
      menu.findItem(R.id.action_camera)
          .setVisible(
              MediaSetUtils.isCameraSource(mMediaSetPath)
                  && GalleryUtils.isCameraAvailable(mActivity));
    }
    actionBar.setSubtitle(null);
    return true;
  }
  private boolean setupCameraButton() {
    if (!GalleryUtils.isCameraAvailable(mActivity)) return false;
    RelativeLayout galleryRoot =
        (RelativeLayout) ((Activity) mActivity).findViewById(R.id.gallery_root);
    if (galleryRoot == null) return false;

    mCameraButton = new Button(mActivity);
    mCameraButton.setText(R.string.camera_label);
    mCameraButton.setCompoundDrawablesWithIntrinsicBounds(
        0, R.drawable.frame_overlay_gallery_camera, 0, 0);
    mCameraButton.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View arg0) {
            GalleryUtils.startCameraActivity(mActivity);
          }
        });
    RelativeLayout.LayoutParams lp =
        new RelativeLayout.LayoutParams(
            RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
    lp.addRule(RelativeLayout.CENTER_IN_PARENT);
    galleryRoot.addView(mCameraButton, lp);
    return true;
  }