Saving Fragment State on Orientation Change

后端 未结 3 1855
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-31 20:22

I\'m creating a file manager app for Android, and two classes below are the majority of the logic that goes into doing that. What I\'m doing is that on startup of the Conten

3条回答
  •  自闭症患者
    2020-12-31 20:55

    use this for save state of fragment on orientation.

    onCreate(Bundle save)
    {
       super.onCreate(save);
       setRetainInstance(true);
    }
    

提交回复
热议问题