FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated. What's the best alternative to use for this?

We were created FragmentPagerAdapter class like below 

class MyViewPagerAdapter(manager: FragmentManager) : FragmentPagerAdapter(manager)

 

By replacing the above code with below code we can resolve the error

class MyViewPagerAdapter(manager: FragmentManager) : FragmentPagerAdapter(manager, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT)

 


Flutter Questions

Android Questions

Python Questions

Java Questions