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 Set Text Color Programmatically Android TextView?
What are Android Versions available?
How to check Android version?
How to start a new activity on button click
What is ANR in android?
How to get complete address from latitude and longitude?
FCM Not Receiving Notifications in Android - RRutors
What is the Different Between val and var in Kotlin?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
What is the difference between match_parent and fill_parent?
Set Activity to Fullscreen Mode in Android - RRutors
What are the notifications available in android?
How to find Android Device UDID or unique ID?
Fix Android Emulator Kill Error When Running Your App
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
What is "shared preferences" in Android ?
How to copy database from assets folder in android using kotlin
How to install/ uninstall apk by command line ADB
ERR_ACCESS_DENIED in Android Webview with sdk 30
What is Android?
What is Intent? What is the difference between an implicit intent and an explicit intent?
Decompile APK Files: How to Get Source Code - RRutors Guide
How can i comment inside xml file in android studio?
Key Points to remember while develop the Android Application.
How to Exit android app on back pressed?
What happens next when the device switches between portrait and landscape?
Fix Duplicate Files in APK Build.gradle Issue - RRutors
Android Studio project R can't find
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
How to convert milli seconds to hours, minutes and seconds in Android?
How to validate email address in Android with Kotlin?
Explain Fragment Life Cycle
Symmetric vs Asymmetric Encryption in Android Server - RRutors
Extract Date and Time from Long Type Variable - RRutors
Add Jar/Library Files as Dependency in Android Studio
How to stop EditText focus at Activity startup in Android?
Open PDF in Google Drive with Intent in Android - RRutors
How to reduce APK package size?
Invoke-customs are only supported starting with android 0 --min-api 26
How do I generate random numbers in Dart?