I must be making a stupid mistake but I cannot figure it out.

My appwidget has to create an alarm that triggers at a user-defined
interval.  In the widget's onReceive method, where I check completion of
configuration or boot completed, I use the following code to obtain the
preference:

SharedPreferences Prefs = PreferenceManager.getDefaultSharedPreferences( 
context );
int locationPeriod = Integer.parseInt( Prefs.getString( 
"KEY_DYNAMIC_REFRESH_INTERVAL", "1" ) );

This code works correctly.

I also want to reschedule that alarm if the user changes the value for
KEY_DYNAMIC_REFRESH_INTERVAL.  So I have the following code in the same
onReceive method:

Prefs.registerOnSharedPreferenceChangeListener( this );

and I implemented the onSharedPreferenceChanged() method in the
AppWidget class.

For some reason, the onSharedPreferenceChanged() method is never being
triggered.  Did I forget to do something?

Thanks.

-- 
Jake Colman -- Android Tinkerer

-- 
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