My Activity stack order is: MainActivity, SettingActivity, ThemeSettingActivity. The ThemeSettingActivity is top activity.
When I use AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) and switch themes through the system settings, only the top activity in the stack receives lifecycle callbacks, while MainActivity and SettingActivity do not receive any callbacks.
However, when I switch themes using AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO) or AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES) in code, if my app is in the foreground, all activities (including the top activity, MainActivity, and SettingActivity) receive lifecycle callbacks, and these callbacks are executed after the lifecycle callbacks of the top activity. The lifecycle callback order of my three activities is as follows:
please help me ~!
I hope the lifecycle callback order to be correct, with the ThemeSettingActivity's onResumed method being called last.
The lifecycle callback order of my three activities is as follows: