1

I used this method to perform some task after the fragment was visible to the user.

Now, this method is deprecated and I am unable to find a proper alternative method which gives a similar callback.

As per the documentation they suggest to use FragmentTransaction.setMaxLifecycle(Fragment, Lifecycle.State) method but I am unable to find a similar callback and so my work is stuck here for a long time.

I have read from the changelog for fragments :

Max Lifecycle: You can now set a max Lifecycle state for a Fragment by calling setMaxLifecycle() on a FragmentTransaction. This replaces the now deprecated setUserVisibleHint(). FragmentPagerAdapter and FragmentStatePagerAdapter have a new constructor that allows you to switch to the new behavior.

If anyone could please suggest me a proper alternative. Thanks in advance.

Mittal Varsani
  • 5,601
  • 2
  • 15
  • 27

0 Answers0