关于onSaveInstanceState的一个问题

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

#安卓工程师#
全部评论
肯定也会调用啊
点赞 回复 分享
发布于 2016-08-09 20:31
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

相关推荐

11-03 14:57
西北大学 营销
Belltrix:其实就是每根转动一定的角度
点赞 评论 收藏
分享
gelmanspar...:奖学金删掉,自我评价删掉,简历压缩一下,写一页
如果再来一次,你还会学机...
点赞 评论 收藏
分享
11-29 00:55
门头沟学院
区域赛银,邀请赛金,打算十二月打下Java基础、背点八股、写个外卖后去投福建小厂的寒假实习,简历应该怎么写呢?以及福州/和厦门有推荐的小厂吗?
牛客53210502...:简历一页:把区域银,邀请赛金标粗,其他的奖除非凑一页否则没有必要写。或者多页:每个站一行这样都列出来。项目经历看看牛客其他人是怎么写的,写的不好呢。简历打磨好按部就班没问题的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务