Beginning Android development, i am having a big problem understanding how listviews and gridviews work and the adapters and their role
am very grateful for anyone who would help me, that will be really a great favor for me.
AdapterView is a ViewGroup that displays items loaded into an adapter. The most common type of adapter comes from an array-based data source.
Android provides several subclasses of Adapter that are useful for retrieving different kinds of data and building views for an AdapterView ( i.e. ListView or GridView). The common adapters are ArrayAdapter,Base Adapter, CursorAdapter, SimpleCursorAdapter,SpinnerAdapter and WrapperListAdapter.
In Android, whenever we want to bind some data which we get from any data source (e.g. ArrayList, HashMap, SQLite, etc.) with a UI component(e.g. ListView, GridView, etc.) then Adapter comes into the picture. Basically Adapter acts as a bridge between the UI component and data sources.
Base class for an Adapter. Adapters provide a binding from an app-specific data set to views that are displayed within a RecyclerView . Parameters. <VH extends RecyclerView.ViewHolder> A class that extends ViewHolder that will be used by the adapter.
An Adapter
is responsible for creating and binding data to views. An Adapter
isn't an actual view, but instead produces them.
An AdapterView
is a ViewGroup that gets its child views from an Adapter
.
E.g. a ListView
has a child view for each row in its list. Those child views are created and bound with data by an Adapter
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With