While working with Viewpager with FragmentPagerAdapter i have noticed this deprecated messages. i have created FragmentPagerAdapter class like below To overcome the issue i have modified FragmentPagerAdapter() constructor Solution 1: By replacing the above code with below code we can resolve the error Solution 2:
class MyViewPagerAdapter(manager: FragmentManager) : FragmentPagerAdapter(manager)
class MyViewPagerAdapter(manager:FragmentManager) : FragmentPagerAdapter(manager, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT)
There is another way to fix the issues by "Migrate from ViewPager to ViewPager2"
By switch from Viewpager to ViewPager2 and create adapter by FragmentStateAdapter or FragmentStatePagerAdapter instead
What is "shared preferences" in Android ?
How to start a new activity on button click
Is There A Way To Get The Source Code From An APK File? (or) How to decompile apk?
What are Android Versions available?
How to convert milli seconds to hours, minutes and seconds in Android?
ERROR Android emulator gets killed when I try to run my application and choose an emulator it ret
How To Set Text Color Programmatically Android TextView?
How to validate email address in Android with Kotlin?
How to Get bitmap from drawable: Android
How to get a contact image using a phone number in android?
What is Context?
Android Studio project R can't find
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
Hide/Disable soft keyboard on Activity launch: Android
What is ANR? How to avoid and resolve it?
How to copy database from assets folder in android using kotlin
What are the notifications available in android?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
How to find Android Device UDID or unique ID?
How to get an image resource by it's name in android?
What is Application?
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to stop EditText focus at Activity startup in Android?
How to reduce APK package size?
What is Android?
Google play store rejected my app due to SMS permission I removed SMS permission from the manifes
Android FCM not receiving notifications when app is removed from background
How to install/ uninstall apk by command line ADB
Intent for Drive PDF Viewer - How to open PDF in Google Drive with intent
What are symmetric and asymmetric encryption in the way Android interacts with the server?
How to Generate signed apk with android studio
What is NetworkOnMainThread Exception?
How to convert DP to Pixel and Pixel to Dp?
Permission denied for window type 2010 in Marshmallow device
ERR_ACCESS_DENIED in Android Webview with sdk 30
How to get screen size (width,height) in Android?
Could not inflate Behavior subclass android.support.design.widget. BottomSheetBehavior How resolve
How do I generate random numbers in Dart?
Error: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path
What happens next when the device switches between portrait and landscape?