androidx.fragment.app.Fragment's setUserVisibleHint()
is Deprecated, so how can I know which fragment
is visible to user in Viewpager2
's FragmentStateAdapter
??
Asked
Active
Viewed 5,749 times
2

Md. Sabbir Ahmed
- 850
- 8
- 22

Ronak Ukani
- 603
- 5
- 20
-
1Check this: https://stackoverflow.com/questions/57885849/in-androidx-fragment-app-fragment-setuservisiblehint-is-deprecated-and-not-exec – Saurabh Thorat Dec 13 '19 at 12:38
-
How can i use this in FragmentStateAdapter? i use viewPager2 – Ronak Ukani Dec 13 '19 at 12:47
-
Only the current fragment is resumed, every other fragment is started – ianhanniballake Dec 13 '19 at 17:52