Array,Custom and Base

548 views.

what is the difference b/w Array,Custom and Base Adapter with syntax?

Add Comment
1 Answer(s)
310 views.

Array:

Java array is an object the contains elements of the similar data type. It is a data structure where we store similar elements. 

In android this we use show multiple items in a single position we use arrays like listview, grid view etc. , but its predefined.

 

When we want to show some list/grid we use array Adapter that is predefined like below using this we can create the only single item in listview

ArrayAdapter adapter = new ArrayAdapter<String>(this, 
R.layout.activity_listview, mobileArray);
listView.setAdapter(adapter);

 

Custom :

When we use Custom we can list with multiple items, so on Custom Adapter, we extend as base adapter because it has 4 implemented methods so easily we can write the using Base Adapter.

for example, code click here

 

 

Answered on June 13, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.