Question

In android programming, we have basic concept about Adapter and ArrayAdapter. To understand the ArrayAdapter i used the following link :

http://developer.android.com/reference/android/widget/ArrayAdapter.html

and to understand adapter i used the following link :

http://developer.android.com/reference/android/widget/Adapter.html

unfortunately, i'm new in android programming, so i'm little bit confused about this concept (about their relationship, main purpose and difference).

its that ArrayAdapter is derived from adapter? If anybody can explain it, it will be great helpful. Thanks and sorry for my bad English :)

Was it helpful?

Solution 2

Adapter is an interface, which pretty much provides the skeleton framework of another class that implements it.

In this case, the (abstract) BaseAdapter class implements Adapter and ArrayAdapter extends the BaseAdapter (you can almost think of it like Adapter is ArrayAdapters grandparent).

Here's some more information on interfaces: http://docs.oracle.com/javase/tutorial/java/concepts/interface.html

The difference between an interface and abstract class can be confusing at first but here's a helpful question: Interface vs Abstract Class (general OO)

OTHER TIPS

Following the information of your link you can see that Adapter is an interface implemented by the interface ListAdapter, implemented by the abstract class BaseAdapter from which ArrayAdapter extends.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top