title: How set value spinner when change textEdit of preferenceScreen?
body: <p>How to change the value of TextEdit of preference screen, I want that TextEdit of MainActivity  to be changed. How can I do it?.</p>
  
  <pre><code>    @Override
  public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
          String key) {
      if (key.equals(PrefUserName)) {
  
          SharedPreferences sharedPref = PreferenceManager
                  .getDefaultSharedPreferences(getApplication());
  
          String textoEditTextPreference = sharedPref.getString(key,
                  "");
          // Spinner spinner = (Spinner) findViewById(R.layout.activity_main);
  
  
          //Here I want add value spinner of main activity...
          // Spinner spinner = (Spinner) findViewById(R.layout.activity_main);
  
          Toast.makeText(
                  getApplication(),
                  "New name of user: "
                          + textoEditTextPreference, Toast.LENGTH_SHORT)
                  .show();
      }
  </code></pre>