如何在onSaveInstanceState中保存片段对象

时间:2017-02-20 02:13:53

标签: android android-fragments onsaveinstancestate

我有一个DialogFragment类,它包含一个类型为Fragment的成员值,当对话框旋转时我需要保存Fragment对象。

现在我的解决方案是使用静态值来记录它,但是我想将它保存在onSaveInstanceState函数中,我发现在Bundle类中有许多函数如putInt,我该如何使用这些函数可以保存Fragment对象吗?以及如何阅读它?

感谢任何帮助!

0 个答案:

没有答案
相关问题