code: private OnClickListener createPreferenceInitialFragmentButtonListener() {
          return new OnClickListener() {
  
              @Override
              public void onClick(final View v) {
                  Intent intent = new Intent(MainActivity.this, SettingsActivity.class);
                  intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT,
                          BehaviorPreferenceFragment.class.getName());
  
                  SharedPreferences sharedPreferences =
                          PreferenceManager.getDefaultSharedPreferences(MainActivity.this);
  
                  boolean useAlternativeTitleDefaultValue =
                          Boolean.valueOf(getString(R.string.use_alternative_title_preference_key));
                  String useAlternativeTitleKey =
                          getString(R.string.use_alternative_title_preference_key);
  
                  if (sharedPreferences
                          .getBoolean(useAlternativeTitleKey, useAlternativeTitleDefaultValue)) {
                      String titleDefaultValue =
                              getString(R.string.alternative_title_preference_default_value);
                      String titleKey = getString(R.string.alternative_title_preference_key);
                      String title = sharedPreferences.getString(titleKey, titleDefaultValue);
                      intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT_TITLE, title);
                  }
  
                  startActivity(intent);
              }
  
          };
      }
docs: Creates a and returns a listener, which allows to show a specific header of a {@link
  PreferenceActivity}.
  
  @return The listener, which has been created, as an instance of the type {@link
  OnClickListener}