如何知道“不要保持活动"是否在 ICS 中启用? [英] How to know "Don't keep activities" is enabled in ICS?

查看:24
本文介绍了如何知道“不要保持活动"是否在 ICS 中启用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过代码在 ics 中启用设置中的不保留活动"选项.如果启用,如何阻止活动.

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.

注意:我在我的应用程序中使用了更多活动.由于该设置,如果我将一个活动移动到另一个活动,第一个活动将被销毁.我可以将我的数据保存在 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...

提前致谢..

推荐答案

之所以出现这个标志,正是因为这个原因.这个想法是检查并确保您的应用程序处理其被销毁的活动.您无法覆盖它,因为在现实世界中,如果设备内存不足,即使没有该标志也可能发生.您需要编写代码来处理这种情况,而不是覆盖它.

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.

这篇关于如何知道“不要保持活动"是否在 ICS 中启用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆