如何知道"不保留活动"在ICS被启用?QUOT、ICS

2023-09-13 00:11:38 作者:D丝的寂寞つ

如何知道设置不保留活动选项中通过code芯片启用。如果在启用了如何prevent活性

How to know in settings "Don't keep activities" option is enabled in ics via code. If it is in enabled,how to prevent the activity.

注:我使用了更多的活动,我application.Because那设置,如果我移动一个活动到另一个活动的第一个活动是destroyed.I可以节省上的onSaveInstanceState我的数据。由于使用了保存实例状态有没有办法做到......

Note: I have used more activities in my application.Because of that settings if I move one activity to another the first activity is destroyed.I can save my data on the onSaveInstanceState. With out using saved instance state is there any way to do...

在此先感谢。

推荐答案

这标志是有正是这个原因。这样做是为了检查并确保您的应用程序处理的活动遭到破坏。你不能覆盖它,因为在现实生活中,可能如果设备内存不足,甚至发生没有该标志。您需要code事情要处理,这种情况下不覆盖它。

That flag is there for exactly this reason. The idea is to check and make sure your app handles its activities being destroyed. You can't override it because in the real world it might happen even without that flag if the device is low on memory. You need to code things to handle this case not override it.