How to know “Don't keep activities” is enabled

2019-01-17 16:53发布

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.

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...

Thanks in advance..

7条回答
Viruses.
2楼-- · 2019-01-17 17:54

The questioner has right and he has got a good question, which is still not be answered :-)

I tested this issue with a clean simple example. The fact is, that when the option 'do not keep activities' is checked, then activities will be killed. For example: A Mainactivity calls a subactivity. The mainactivity is killed. Pressing back on the subactivity results in restarting the Mainactivity. This can be a problem, when the mainactivity is doing longrunning stuffs like loading content.

My conclusion on this. The option 'do not keep activites' is an developer option and should not be set under normal user-conditions. So developer should be able to detect this setting.

查看更多
登录 后发表回答