关于onSaveInstanceState的一个问题

在《android源码设计模式解析与实战》这本书中,写到关于onSaveInstanceState这一章,里面说从activityA中启动一个新的activityB时 onSaveInstanceState会被调用,而某个activity跳转到其他activity则不会调用?????
啥意思?

#安卓工程师#
全部评论
API里面这么说的: This method is called before an activity may be killed so that when it comes back some time in the future it can restore its state. For example, if activity B is launched in front of activity A, and at some point activity A is killed to reclaim resources, activity A will have a chance to save the current state of its user interface via this method so that when the user returns to activity A, the state of the user interface can be restored via  onCreate(Bundle)  or  onRestoreInstanceState(Bundle) . 也就是在销毁一个Activity之前调用,估计书中说的“ 启动 ”是先finish再startActivity,跳转直接就是startActivity,这样就能说的通了。
点赞 回复 分享
发布于 2016-08-09 17:53
肯定也会调用啊
点赞 回复 分享
发布于 2016-08-09 20:31

相关推荐

头像
10-16 09:58
已编辑
门头沟学院 Java
点赞 评论 收藏
分享
我见java多妩媚:大外包
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务