Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes?

You can add below 2 lines into your gradle.properties file: android.useAndroidX=true android.enableJetifier=true Note to check, to not repeat any line that already exists (and ensure existing are true). Details: If you want to use androidx-namespaced libraries in a new project, you need to set the compile SDK to Android 9.0 (API level 28) or higher … Read more

How to disable swiping in ViewPager2?

Now it is possible to enable-disable swiping viewpager2 using Version 1.0.0-alpha02 Use implementation ‘androidx.viewpager2:viewpager2:1.0.0-alpha02’ Version 1.0.0 New features Ability to disable user input (setUserInputEnabled, isUserInputEnabled) API changes ViewPager2 class final Bug fixes FragmentStateAdapter stability fixes SAMPLE CODE to disable swiping in viewpager2 myViewPager2.setUserInputEnabled(false); SAMPLE CODE to enable swiping in viewpager2 myViewPager2.setUserInputEnabled(true);

How to set RecyclerView app:layoutManager=”” from XML?

As you can check in the doc: Class name of the Layout Manager to be used. The class must extend androidx.recyclerview.widget.RecyclerViewView$LayoutManager and have either a default constructor or constructor with the signature (android.content.Context, android.util.AttributeSet, int, int) If the name starts with a ‘.’, application package is prefixed. Else, if the name contains a ‘.’, the … Read more

What is AndroidX?

AndroidX – Android Extension Library From AndroidX documentation We are rolling out a new package structure to make it clearer which packages are bundled with the Android operating system, and which are packaged with your app’s APK. Going forward, the android.* package hierarchy will be reserved for Android packages that ship with the operating system. … Read more

AndroidJUnit4.class is deprecated: How to use androidx.test.ext.junit.runners.AndroidJUnit4?

According to the documentation for AndroidJUnit4, The gradle file should contain the following line: androidTestImplementation ‘androidx.test.ext:junit:1.1.1′ Change test class to AndroidJUnit4ClassRunner from AndroidJUnit4 If it still doesn’t work, make sure that you clean and/or rebuild your project. Also you can check the current version directly in Google’s maven repository