ykhrustalev
ykhrustalev

Reputation: 596

What method is called when PreferenceActivity saves values

I have an app which uses PreferenceActivity to define time period to run scheduled tasks. But I can't the right method to Override in PreferenceActivity to make tasks rescheduled on period values changed.

Does anyone know what method is called when PreferenceActivity saves values? I am using API 8 level and seems that onSaveInstanceState(Bundle outState) is not that I am looking for.

Upvotes: 0

Views: 464

Answers (1)

user658042
user658042

Reputation:

There is no callback for changed preferences in a PreferenceActivity. But you can use the normal OnSharedPreferenceChangeListener that you would use everywhere else. Just register it in and you'll get notified when a preference changes. Check for the correct key in the callback and reschedule your tasks.

Upvotes: 1

Related Questions