I've implemented two simple themes on my app, you can select them inside a SettingsActivity
(extending PreferenceActivity
).
At this point, when you change theme, it's applied only on the new created activities because the activity from where you called the settings is an old one in the activity stack.
I've searched a lot and I've found this pretty useful: how to restart an activity.
By the way, I'm not completely clear on WHERE put this code. The only way to make it works was to put it in the onRestart()
method,
but this is a HUGE wasting of cpu, battery and user experience.
Any help?