Leak Canary detects memory leaks for TabLayout with ViewPager2

后端 未结 4 1338
遇见更好的自我
遇见更好的自我 2020-12-18 00:35

I followed the official documentation to setup a TabLayout with ViewPager2. I used the TabLayoutMediator this way to connect the TabLayout with the ViewPager2:



        
4条回答
  •  清酒与你
    2020-12-18 00:53

    I had the same similar problem, you need to set the viewPager adapter to null inside onDestroyView , then possible if you are using databinding make sure u set the binding to null. Goodluck

提交回复
热议问题