Step #2: Adding Support for RecyclerView
The idea is that the ToDo app will present a list of tasks to be done. That requires that we have something to display a list to the user. There are two typical solutions for that problem: ListView
and RecyclerView
. RecyclerView
is more modern and more flexible, so it is a good choice for this problem.
However, ListView
does have one advantage over RecyclerView
: ListView
is part of the framework portion of the Android SDK, and so it is always available to apps. RecyclerView
requires us to add a dependency to the app.
Fortunately, we happen to be in a tutorial where we are working with the dependencies in the app.
To that end, inside the dependencies
closure, add the following line:
implementation "androidx.recyclerview:recyclerview:1.2.1"
At this point, you should get a banner at the top of the editor, offering you the chance to “Sync Now”:
Go ahead and click the “Sync Now” link in the banner at the top of the editor.
Prev Table of Contents Next
This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.