Hi folks,

I'm trying to listen for preference changes from an activity (see below). It
never fires. Is it due to the fact that the activity in question is not in
focus when the change event fires?

sharedPrefs = PreferenceManager.getDefaultSharedPreferences(
getApplicationContext() );

SharedPreferences.OnSharedPreferenceChangeListener prefListener = new
SharedPreferences.OnSharedPreferenceChangeListener()
{
  @Override
  public void onSharedPreferenceChanged( SharedPreferences
sharedPreferences, String key )
  {
     Log.w( TAG, "Pref key: " + key );
  }
};
sharedPrefs.registerOnSharedPreferenceChangeListener( prefListener );

Cheers,
Stacy

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to