ViewPager and fragments — what's the right way to store fragment's state?

后端 未结 11 1525
遇见更好的自我
遇见更好的自我 2020-11-22 02:21

Fragments seem to be very nice for separation of UI logic into some modules. But along with ViewPager its lifecycle is still misty to me. So Guru thoughts are b

11条回答
  •  半阙折子戏
    2020-11-22 02:32

    add:

       @SuppressLint("ValidFragment")
    

    before your class.

    it it doesn´t work do something like this:

    @SuppressLint({ "ValidFragment", "HandlerLeak" })
    

提交回复
热议问题