code: private void initializeShowCustomBottomSheetPreference() {
          Preference showCustomBottomSheetPreference =
                  findPreference(getString(R.string.show_custom_bottom_sheet_preference_key));
          showCustomBottomSheetPreference
                  .setOnPreferenceClickListener(new OnPreferenceClickListener() {
  
                      @Override
                      public boolean onPreferenceClick(final Preference preference) {
                          initializeCustomBottomSheet();
                          customBottomSheet.show();
                          return true;
                      }
  
                  });
      }
docs: Initializes the preference, which allows to show a bottom sheet with custom content.