Generating lists
The RecyclerView is a relatively recent addition and replaces the ListView on older versions. It performs the same functions but manages data far more efficiently, particularly very long lists. The RecyclerView is part of the v7 support library and needs to be compiled in the build.gradle
file, along with the others shown here:
compile 'com.android.support:appcompat-v7:24.1.1'compile 'com.android.support:design:24.1.1'compile 'com.android.support:cardview-v7:24.1.1'compile 'com.android.support:recyclerview-v7:24.1.1'
The coordinator layout will form the root layout of the main activity and will look like this:
<android.support.design.widget.CoordinatorLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:id="@+id/content"android:layout_width="match_parent"android:layout_height="match_parent"></android.support.design.widget.CoordinatorLayout>
The Recycler view can then be placed inside the layout...