What's the role of adapters in Android?

前端 未结 10 1219
面向向阳花
面向向阳花 2020-12-02 04:10

I want to know when, where and how adapters are used in the context of Android.

The information from Android\'s developer documentation wa

10条回答
  •  鱼传尺愫
    2020-12-02 04:56

    An adapter acts as a bridge between an AdapterView and the underlying data for that view. The adapter provides access to the data items and is responsible for creating a view for each item in the data set.

    Adapters are a smart way to connect a View with some kind of data source. Typically, your view would be a ListView and the data would come in form of a Cursor or Array. So adapters come as subclasses of CursorAdapter or ArrayAdapter.

提交回复
热议问题