What's the difference between BaseAdapter and ArrayAdapter?

前端 未结 6 2108
轮回少年
轮回少年 2020-12-07 09:42

I want to know the difference between using BaseAdapter and ArrayAdapter.

I have been achieving what I want through ArrayAdapters

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-07 10:00

    BaseAdapter is abstract while ArrayAdapter extends BaseAdapter (it is a concrete implementation of a BaseAdapter). If you extends for ArrayAdapter you are inheriting all the ArrayAdapter's features and, override its implementation you can modify the ArrayAdapter behavior. If you extends BaseAdapter you must implements all the Abstract methods, that ArrayAdapter already implements.

    Also, does it affects the performance of the ListView

    no it does not.

    And, the last question is, can i achieve anything doing with ListView using any of these Adapters, or, there are certain cases where specific adapter only can be used ?

    If the implementation in the SDK fulfill your needs why you need to override it and re-invent the wheel?

    The main difference between them is that BaseAdapter can not be instantiate while ArrayAdapter can

提交回复
热议问题