Adapter

The word adapter says it all: it adapts itself to be a bridge between the data source and the type of view this data has to be displayed in; basically, the adapter view.

The data here might be of any kind, but it needs to be displayed in the same view, for which an adapter plays an important role.

The following figure identifies how the adapter binds the data with the view:

The data could be in any form, such as List, ArrayList, Array, Cursor, and so on. This kind of data needs to be displayed in the RecyclerView, Spinner, and so on, to display the data in a list.

The adapter does not know what kind of data it is going to handle. It ...

Get Expert Android Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.