@Override
          public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
            // This function can be triggered twice as user can double click the item while it is on
            // the
            // dismissing animation, we ignore the second click by checking if the item is
            // unselected.

            if (userList.getCheckedItemCount() == 0) {
              return false;
            }
            int position = getMultiSelectListSingleCheckedItemPosition(userList);
            if (onContextItemSelected(item, position)) {
              mode.finish();
              return true;
            }
            return false;
          }
Called when the activity is first created.
java/com/google/android/apps/authenticator/AuthenticatorActivity.java