code: private void initializeShowBottomSheetPreference() {
          Preference showBottomSheetPreference =
                  findPreference(getString(R.string.show_bottom_sheet_preference_key));
          showBottomSheetPreference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
  
              @Override
              public boolean onPreferenceClick(final Preference preference) {
                  initializeBottomSheet();
                  bottomSheet.show();
                  return true;
              }
  
          });
      }
docs: Initializes the preference, which allows to show a bottom sheet.