What's the role of adapters in Android?



Well adapters in Android are basically a bridge between the UI components and the data source that fill data into the UI Component
For example, Lists (UI Component) get populated by using a list adapter, from a data source array.

Let’s assume you want to display a list in your Android app. For this you will use the ListViewprovided by Android. ListViews don’t actually contain any data themselves. It’s just a UI element without data in it. You can populate your ListViews by using an Android adapter.
Adapter is an interface whose implementations provide data and control the display of that data. ListViews own adapters that completely control the ListView’s display. So adapters control the content displayed in the list as well as how to display it.

Comments

Popular posts from this blog

Difference Between View and ViewGroup

How to remove ActionBar from Android Activity