Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
533 views
in Technique[技术] by (71.8m points)

android - What is the difference between ArrayAdapter , BaseAdapter and ListAdapter

Could you please tell me difference between ArrayAdapter , BaseAdapter and ListAdapter.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

BaseAdapter as the name suggests, is a base class for all the adapters.

When you are extending the Base adapter class you need to implement all the methods like getCount(), getId() etc.

ArrayAdapter is a class which can work with array of data. You need to override only getview() method.

ListAdapter is a an interface implemented by concrete adapter classes.

BaseAdapter is an abstract class whereas ArrayAdapter and ListAdapter are the concrete classes.

ArrayAdapter and ListAdapter classes are developed since in general we deal with the array data sets and list data sets.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...