title: How to update ListPreferences after implementing OnChangeListener
body: <p>I have PrefActivity and I use OnChange Listener to make a toast when ever user change any button in list preferences.
  But now I have 2 problems:
  1-first time that user change an option toast is not shown
  2-after that, when ever user change prefrences, the value of list is not updated, and is always set on second value.</p>
  
  <p>this is my code:</p>
  
  <pre><code>public class PrefsActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener{
  
  private ListPreference myPreference;
  @Override
   public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState); 
  addPreferencesFromResource(R.xml.prefs);
  
  SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
  prefs.registerOnSharedPreferenceChangeListener(this);
  
  }
  
   public void onSharedPreferenceChanged(SharedPreferences arg0, String key) {
  
  ListPreference lp = (ListPreference) findPreference("blocktype");
   lp.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
  
      @Override
      public boolean onPreferenceChange(Preference preference, Object newValue) {
          // TODO Auto-generated method stub
  
          Toast.makeText(PrefsActivity.this, "second", Toast.LENGTH_LONG).show();
          return false;
  
  
      }
  
  });
  }
  }
  </code></pre>
  
  <p>What is</p>