What is the difference between adapter and adapter in Android?

Starting with Android development, I had a big problem understanding how lists and gridviews work, as well as adapters and their role.

I am very grateful to everyone who helped me, this will be a great service for me.

+6
source share
4 answers

An Adapter is responsible for creating and binding data to views. Adapter not an actual view, but instead produces them.

An AdapterView is a ViewGroup that gets its child views from the Adapter .

eg. a ListView has a child view for each row in its list. These child views are created and data bound using the Adapter .

+8
source

All answers summarize it. But I think:

AdapterView has an adapter. The adapter has data.

T. AdapterView <- Adapter <- Data p>

+5
source

From the documents

Adapter :

The Adapter object acts as a bridge between the AdapterView and the underlying data for this view. The adapter provides access to items data. The adapter is also responsible for creating a view for each item in the dataset.

AdapterView :

AdapterView is a view whose children are defined by the adapter.

+4
source

If you have not read the documents, I suggest you do it. They are pretty clear on this general issue.

In AdapterView Documents

AdapterView is a view whose children are defined by the adapter.

From adapter docs

The Adapter object acts as a bridge between the adapter and the underlying data for this view.

So basically you have a View that displays data. The data comes from the Adapter , and AdapterView combines the data and the View , displaying a list of View s.

+1
source

All Articles