I have a PreferenceActivity with settings for my application, and I want to update activity if some settings have been changed.
For example, I have a flag that is responsible for the added tab in my layout when the flag is checked. To catch this event, I used OnSharedPreferenceChangeListener. But this listener clicks on this flag every time and does something (your logic) every time, every click, even if the setting really has not changed. I want to update my activity only if the setting has really been changed. If before it was “OFF” and now it has become “ON”, in this case I want to update, but if I changed OFF - ON-OFF, I do not want to update.
How to really catch the change and how to deal with it in action?
Thank!
source
share