Android fragments setRetainInstance(true) not works (Android support library)

后端 未结 2 1373
伪装坚强ぢ
伪装坚强ぢ 2020-12-20 02:30

I have a problem with saving fragment state. I try to use setRetainInstance, but cant make it work((( I change a state to 2 using button1, but after changing screen orientat

2条回答
  •  醉梦人生
    2020-12-20 03:16

    Your fragment will only get re-used if you give the fragment an Id in the layout, change

    
    

    to be

    
    

提交回复
热议问题