BaseAdapter or ArrayAdaptor - Android

前端 未结 1 798
执笔经年
执笔经年 2020-12-05 10:56

I am going to make a grid of images and I am trying to figure out whether to use an array adaptor or a baseadaptor. While the GridView example, stores the data in an array,

1条回答
  •  悲&欢浪女
    2020-12-05 11:35

    You typically choose your adapter class based on what the model data is. If you have an ArrayList of objects, use ArrayAdapter. If you have a Cursor from a database query, use a CursorAdapter. BaseAdapter can be used for anything, but it requires more coding, since it has no innate knowledge of how to iterate over the data.

    0 讨论(0)
提交回复
热议问题