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 the difference between match_parent and fill_parent?
How to Exit android app on back pressed?
What are Android Versions available?
Fix Play Store Rejection Due to SMS Permission - RRutors
What happens next when the device switches between portrait and landscape?
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
How to get screen size (width,height) in Android?
Symmetric vs Asymmetric Encryption in Android Server - RRutors
Invoke-customs are only supported starting with android 0 --min-api 26
Open PDF in Google Drive with Intent in Android - RRutors
What is "shared preferences" in Android ?
How to install/ uninstall apk by command line ADB
How to find Android Device UDID or unique ID?
How to Use Deprecated Handler() in Android - RRutors Guide
Set Activity to Fullscreen Mode in Android - RRutors
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
Hide/Disable soft keyboard on Activity launch: Android
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
How to copy database from assets folder in android using kotlin
Fix Android Emulator Kill Error When Running Your App
ERR_ACCESS_DENIED in Android Webview with sdk 30
Decompile APK Files: How to Get Source Code - RRutors Guide
How do I check in SQLite whether a table exists?
How to convert DP to Pixel and Pixel to Dp?
Check List for Generate Signed APK Android
FCM Not Receiving Notifications in Android - RRutors
What is Intent? What is the difference between an implicit intent and an explicit intent?
What is the Different Between val and var in Kotlin?
How to validate email address in Android with Kotlin?
Key Points to remember while develop the Android Application.
How do I generate random numbers in Dart?
How to get a contact image using a phone number in android?
How can i comment inside xml file in android studio?
How to reduce APK package size?
How to start a new activity on button click
How to convert milli seconds to hours, minutes and seconds in Android?
What is NetworkOnMainThread Exception?
What is Android Fragments?
How To Set Text Color Programmatically Android TextView?