I'm implementing a setting to my app that allows the user to switch themes, the user will be in the settings activity when he switches the theme, and above it in the task will be the main screen.
I want the current activity
to restart after the theme change, but I also want the main screen to restart, so when the user hits back from the settings page, he'll see the main screen with the new activity.
Restarting the current activity
is easy, but how do I force the previous activities
in the current task
to restart as well?
I've tried adding FLAG_ACTIVITY_CLEAR_TOP
/ FLAG_ACTIVITY_CLEAR_TASK
to the intent
, but it'll remove those activities from the task
, so when I hit back from settings, I'm returned to the home screen and not to my app main screen.
Thanks.