将“捆绑savedInstanceState”活着申请被杀害后? [英] Will 'Bundle savedInstanceState' be alive after Application is being killed?

查看:145
本文介绍了将“捆绑savedInstanceState”活着申请被杀害后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

威尔 savedInstanceState 捆绑在的onCreate()法活(NOT NULL)应用之后被杀害?如果可以,在这里Bundle储存在系统中。

Will savedInstanceState bundle in onCreate() method be alive (not null) after Application is being killed? If it would, where this bundle is stored in the system.

推荐答案

如果机器人杀死托管您的应用程序的过程中,它仍然保持了保存实例状态的所有活动(非成品)的活动。这个数据是由 ActivityManager 存储。如果用户返回到您的应用程序,Android将创建应用程序的新工艺,再次实例化应用程序实例,然后在创建热门活动的一个实​​例活动堆栈。然后,它会调用的onCreate()在该活动实例传递给它的保存实例状态这是最近保存该活动。

If Android kills the process hosting your app, it still maintains the "saved instance state" of all active (non-finished) activities. This data is stored by the ActivityManager. If the user returns to your application, Android will create a new process for the app, instantiate the Application instance again and then create an instance of the top activity in the activity stack. It will then call onCreate() on that activity instance passing it the "saved instance state" that was most recently saved for that activity.

如果你重新启动你的手机,所有这些数据都将丢失(Android不保存在重新启动后应用程序的状态)。

If you reboot your phone, all this data is lost (Android does not save application state across reboots).

这篇关于将“捆绑savedInstanceState”活着申请被杀害后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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