@Override
          public void onItemCheckedStateChanged(
              ActionMode mode, int position, long id, boolean checked) {
            if (checked) {
              mode.setTitle(users[position].getIndex().getStrippedName());

              // Ensure that only one item is checked, by unchecking all other checked items.
              SparseBooleanArray checkedItemPositions = userList.getCheckedItemPositions();
              for (int i = 0, len = userList.getCount(); i < len; i++) {
                if (i == position) {
                  continue;
                }
                boolean itemChecked = checkedItemPositions.get(i);
                if (itemChecked) {
                  userList.setItemChecked(i, false);
                }
              }

              updateCabForAccount(mode, mode.getMenu(), users[position]);
              userAdapter.notifyDataSetChanged();
            }
          }
Called when the activity is first created.
java/com/google/android/apps/authenticator/AuthenticatorActivity.java