I want to know the difference between using BaseAdapter
and ArrayAdapter
.
I have been achieving what I want through ArrayAdapters
One more difference between BaseAdapter and ArrayAdapters is, if you extend array adapter you have to call super class constructor in the subclass constructor.
UserListAdapter extends ArrayAdapter{
List UserList;
Context context;
public UserListAdapter(Context context, int resource,List listUsers) {
super(context, resource, listUsers); /* Super class constructor is called */
UserList = listUsers;
this.context = context;
}
}
But there is no super class for BaseAdapter. As BaseAdapter serves as super class for all other adapters
UserListAdapter extends BaseAdapter{
List UserList;
Context context;
public UserListAdapter(Context context, int resource,List listUsers) {
/* No super class constructor */
UserList = listUsers;
this.context = context;
}
}