private static void copyStringToClipboard(Context context, String code) {
    ClipboardManager clipboard = (ClipboardManager) context.getSystemService(CLIPBOARD_SERVICE);
    ClipData clip = ClipData.newPlainText(context.getString(R.string.clipboard_label), code);
    clipboard.setPrimaryClip(clip);
  }
Gets the position of the one and only checked item in the provided list in multiple selection
mode.

@return {@code 0}-based position.
@throws IllegalStateException if the list is not in multiple selection mode, or if the number
    of checked items is not {@code 1}.
java/com/google/android/apps/authenticator/AuthenticatorActivity.java