private void updateActionModeMenu(boolean doNotCloseActivity){
  if (mActionModeCallback != null && mActivity != null && !mActivity.isFinishing()) {
    if (mItems.size() > 0 && mActionMode == null) {
      mActionMode=mActivity.startSupportActionMode(mActionModeCallback);
    }
    if (mItems.size() == 0 && mActionMode != null) {
      ActionMode actionMode=mActionMode;
      mActionMode=null;
      actionMode.finish();
    }
    if (mActionMode != null) {
      mActionMode.invalidate();
    }
  }
}

private void updateActionModeMenu ( boolean doNotCloseActivity ) { if ( mActionModeCallback != null && mActivity != null && ! mActivity . isFinishing ( ) ) { if ( mItems . size ( ) > 0 && mActionMode == null ) { mActionMode = mActivity . startSupportActionMode ( mActionModeCallback ) ; } if ( mItems . size ( ) == 0 && mActionMode != null ) { ActionMode actionMode = mActionMode ; mActionMode = null ; actionMode . finish ( ) ; } if ( mActionMode != null ) { mActionMode . invalidate ( ) ; } } }
updates the action mode menu
