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

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

in androidx.fragment.app.Fragment,setUserVisibleHint()is Deprecated,and not executed,why?

They just changed API in Fragments. If you use this method to limit fragments lifecycle: You can now set a max Lifecycle state for a Fragment by calling setMaxLifecycle() on a FragmentTransaction. This replaces the now deprecated setUserVisibleHint(). Source: https://developer.android.com/jetpack/androidx/releases/fragment#1.1.0-alpha07 . If you need this method because you try to detect which fragment is currently … Read more

AndroidX:Appcompat I:art error android.view.View$OnUnhandledKeyEventListener

As A.L.Flanagan mentioned in a comment the problem is that android.support.v4.view.ViewCompat does not implement View.OnUnhandledKeyEventListener in the new androidx package structure and only implements it starting on API 28 in the support lib structure (at least in version 28.0.0). Therefore the warning appears on devices with API <28 and does not appear on those >=28. … Read more