private void showModalBottomSheet() {
    bottomSheetDialog = new BottomSheetDialog(this);
    bottomSheetDialog.setContentView(R.layout.main_bottom_sheet);
    bottomSheetDialog
        .findViewById(R.id.bottom_sheet_scan_barcode_layout)
        .setOnClickListener(
            new OnClickListener() {
              @Override
              public void onClick(View view) {
                startActivity(getLaunchIntentActionScanBarcode(AuthenticatorActivity.this, false));
                if (bottomSheetDialog != null) {
                  bottomSheetDialog.dismiss();
                }
              }
            });
    bottomSheetDialog
        .findViewById(R.id.bottom_sheet_enter_key_layout)
        .setOnClickListener(
            new OnClickListener() {
              @Override
              public void onClick(View view) {
                startActivity(new Intent(AuthenticatorActivity.this, EnterKeyActivity.class));
                if (bottomSheetDialog != null) {
                  bottomSheetDialog.dismiss();
                }
              }
            });
    bottomSheetDialog.show();
  }
Invoked when a context menu/action bar item is clicked/tapped.

@return {@code true} if the event was consumed, {@code false} otherwise.
java/com/google/android/apps/authenticator/AuthenticatorActivity.java