title: How to get value from PreferenceFragment to another Activity
body: <p>I need to get value from PreferenceFragment to SplashActivity. How can i do it?</p>
  
  <pre><code>public class SettingsFragment extends PreferenceFragment {
  
  public String cityToLoad;
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      addPreferencesFromResource(R.xml.preferences);
  
       ListPreference city = (ListPreference) findPreference("city");
      city.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
          @Override
          public boolean onPreferenceChange(Preference preference, Object newValue) {
              cityToLoad = newValue.toString();
  
              return true;
          }
      });
  
  }}
  </code></pre>
  
  <p>my preferences.xml contains only ListPreference.</p>