Create custom ArrayAdapter
step - 1 create a listview in activity.xml. create rootview as linerlayout step - 2 create a customview for listview. here we are doing this because we have created a listview but what will be in that list view is decided by the custom view step - 3 create a custom class for custom layout. step - 4 create custom array adapter. public class NumbersViewAdapter extends ArrayAdapter<NumbersView> { // invoke the suitable constructor of the ArrayAdapter class public NumbersViewAdapter( @NonNull Context context, ArrayList<NumbersView> arrayList) { // pass the context and arrayList for the super ...
Comments
Post a Comment