I am using the following RecyclerView
:
<androidx.recyclerview.widget.RecyclerView ... />
which has the following dependency in the build.gradle
:
implementation 'androidx.recyclerview:recyclerview:1.0.0'
which is downloaded after clicking the download button in front of the RecyclerView
in Design
mode of android studio.
I run my application on Oreo
and it works perfectly.
But when i run the app on KitKat
, the application is killed, so I comment out the RecyclerView
and its related source code and run the application again and this time application runs properly on KitKat
, so i realize that the problem is with the RecyclerView
for the KitKat
version.
Now i did a bit research and found that i have to use the:
implementation 'com.android.support:recyclerview-v7:28.0.0'
and following xml tag:
<android.support.v7.widget.RecyclerView ... />
Now my question is that what is the difference between the
<androidx.recyclerview.widget.RecyclerView ... />
implementation 'androidx.recyclerview:recyclerview:1.0.0'
and
<android.support.v7.widget.RecyclerView ... />
implementation 'com.android.support:recyclerview-v7:28.0.0'
Which one is created for which purpose and which one should be used in which situation? Why android studio download the one that is not supported on KitKat
instead of downloading the one that is supported on almost previous version of android? Thanks!!!