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
How to validate email address in Android with Kotlin?
How to find Android Device UDID or unique ID?
How can i comment inside xml file in android studio?
Key Points to remember while develop the Android Application.
How to avoid multiple button click at same time in android?
Symmetric vs Asymmetric Encryption in Android Server - RRutors
How to convert milli seconds to hours, minutes and seconds in Android?
Open PDF in Google Drive with Intent in Android - RRutors
What is the difference between match_parent and fill_parent?
Decompile APK Files: How to Get Source Code - RRutors Guide
How to stop EditText focus at Activity startup in Android?
What is Android?
How to Exit android app on back pressed?
What are Android Versions available?
What is the Different Between val and var in Kotlin?
How to get an image resource by it's name in android?
How to get screen size (width,height) in Android?
What is ANR? How to avoid and resolve it?
Check List for Generate Signed APK Android
How to get a contact image using a phone number in android?
How to Get bitmap from drawable: Android
How to Generate signed apk with android studio
How to convert DP to Pixel and Pixel to Dp?
Permission denied for window type 2010 in Marshmallow device
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
Extract Date and Time from Long Type Variable - RRutors
Fix Play Store Rejection Due to SMS Permission - RRutors
How to get complete address from latitude and longitude?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
How to copy database from assets folder in android using kotlin
How to reduce APK package size?
Fix Duplicate Files in APK Build.gradle Issue - RRutors
How to save activity State in Android?
What is Intent? What is the difference between an implicit intent and an explicit intent?
What is NetworkOnMainThread Exception?
How do i load image from drawable folder in Jetpack Compose?
Fix Android Emulator Kill Error When Running Your App
Android Studio project R can't find
Add Jar/Library Files as Dependency in Android Studio
Hide/Disable soft keyboard on Activity launch: Android