Hey, What About ListView?

If you read about Android from older sources, you will see a lot of discussion of ListView.

ListView is a subclass of AdapterView. The AdapterView family of classes is the precursor to RecyclerView. Like RecyclerView, they display collections of data. And, like RecyclerView, they use an adapter to convert your data into visual representations to display. However, on the whole, the AdapterView widgets were less configurable and less powerful than is RecyclerView.

Almost every AdapterView subclass that is part of the Android SDK could be replaced by RecyclerView. ListView and GridView can be replaced very easily. Gallery would take a bit more work. Many third-party libraries exist for implementing tree structures — parents with children, like a directory tree — in RecyclerView, to replace ExpandableListView.

The main exception is Spinner, which implements a drop-down list. RecyclerView cannot reproduce this sort of widget directly, though it could be used as part of some larger replacement.


Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.