Reputation: 25
My service class can edit and store new value of sharedpreferences
so i want to retrieve it in another activity, its working fine.
Now what i would like to do, once service altered sharedpreferences, i want the sharedprefrences value to be updated in activity.
I used timer but it returns nullpointerexception. Any idea why?
Upvotes: 0
Views: 287
Reputation:
Use an OnPreferenceChangeListener to monitor changes to your SharedPreference
.
Upvotes: 1
Reputation: 14600
Not sure how a timer would help you in the scenario you've described. You may want to look into other options, such as:
Upvotes: 0