本文介绍了android 片段 onRestoreInstanceState的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是不是遗漏了什么,或者 Fragment
没有 onRestoreInstanceState()
方法?如果没有,我该如何实现类似的目标?
Am I missing something or do Fragment
s not have a onRestoreInstanceState()
method? If not, how do I go about attaining something similar?
推荐答案
Fragment 没有 onRestoreInstanceState
方法.
Fragments do not have an onRestoreInstanceState
method.
您可以在 onActivityCreated
中获得相同的结果,它接收一个带有保存的实例状态(或 null)的包.
You can achieve the same result in onActivityCreated
, which receives a bundle with the saved instance state (or null).
在此处检查源代码.
这篇关于android 片段 onRestoreInstanceState的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!