July 2018
Intermediate to advanced
266 pages
7h 11m
English
Currently, the best way to display a list of scrollable items in an Android application is to use a RecyclerView, so we will add one to our activity. Let's update the build.gradle file of the module, adding the dependency:
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) ... // Android support implementation "com.android.support:recyclerview-v7:26.1.0" ...}
Once the project has synchronized the changes, you will be able to add a RecyclerView to the layout. Let's go to activity_main.xml and remove the layout of both of the text views. The ConstraintLayout inside the XML should now only contain the ProgressBar:
<?xml version="1.0" encoding="utf-8"?><android.support.constraint.ConstraintLayout ...
Read now
Unlock full access