2
我有一个首选项活动,允许用户修改蒙皮选项。如果用户修改了蒙皮选项,我需要重新加载活动(使用当前意图调用startActivity(),然后使用finish()),以便正确重新载入drawable。任何方式强制一个活动立即销毁,但也保持在堆栈上?
如果我可以强制当前活动在偏好活动开始时被破坏而不是暂停,那将会容易得多,而且更可靠。
任何想法,我可以如何实现这一点?
更新为清楚:
当前的行为:
1. Activity A starts
2. User selects Settings command
3. Preference Activity starts
4. Activity A is paused
5. User changes preferences
6. Preference Activity is paused and destroyed
7. Activity A is unpaused
8. Activity A must check if preferences were changed
- If yes, call startActivity() to start itself
again and call finish(). This will reload everything
correctly
期望的行为(在BOLD差异):
1. Activity A starts
2. User selects Settings command
3. Preference Activity starts
4. Activity A is paused AND DESTROYED
5. User changes preferences
6. Preference Activity is paused and destroyed
7. Activity A STARTS AGAIN FRESH
干杯, 猪