@Override
    public void onDismiss(DialogInterface dialog) {
      super.onDismiss(dialog);
      if (mActionModeBase == null) {
        return;
      }

      mActionModeBase.mDialog = null;
      mActionModeBase.finish();
    }
 static ActionModeBase startInternal(final FragmentActivity activity, Callback callback) {
   final ActionModeBase actionMode = new ActionModeBase(activity, callback);
   actionMode.startInternal();
   return actionMode;
 }