code: private OnPreferenceChangeListener createThemeChangeListener() {
          return new OnPreferenceChangeListener() {
  
              @Override
              public boolean onPreferenceChange(final Preference preference, final Object newValue) {
                  Intent intent = getActivity().getIntent();
                  getActivity().finish();
                  startActivity(intent);
                  return true;
              }
  
          };
      }
docs: Creates and returns a listener, which allows to adapt the app's theme, when the value of the
  corresponding preference has been changed.
  
  @return The listener, which has been created, as an instance of the type {@link
  OnPreferenceChangeListener}