How to add cardview in layout xml in AndroidX
After upgraded to AndroidX
I think the Best Approach
should be like, understanding the problem statement first.
Scenario:
Solution :
Go to Artifact Mappings page of Android Developer Site and Search for your desired library.
Now go to AndroidX Releases page and check for the current version number
now go to build.gradle[module.app]
add the library you want. (ie. CardView in my case) and press
Sync Now
and necessary files will be added to your project by gradle.
See the image below:
Now in xml file you should get CardView or something you have just imported.
NB: pictures included here are (the first two) taken from Android Developer's Page which belongs to Google Inc and could be different depending on the time you see. See this post's posting time.