

Invisible container that defines the layout structure for View and otherįigure 1. ListItemMap.A layout defines the structure for a user interface in your app, such as in an activity.Īll elements in the layout are built using a hierarchy of View andĭraws something the user can see and interact with. ListItemMap.put("imageId", R.mipmap.ic_launcher) Public class ListViewActivity extends AppCompatActivity void onCreate(Bundle savedInstanceState) ĪrrayList> itemDataList = new ArrayList>() įor(int i =0 i listItemMap = new HashMap() ArrayAdapter arrayAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_multiple_choice, dataList) package

Even it is a checkbox, it can be single checked if ListView’s android:choiceMode value is singleChoice.

simple_list_item_2 : Each list item is a TextView object, text size is bigger.simple_list_item_1 : Each list item is a TextView object.Please note the second parameter for ArrayAdapter constructor can have below values. If you can not watch the above video, you can see it on the youtube URL
