
ListItemMap.put("imageId", R.mipmap. 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.


Comments are added in the code to get to know in detail. Navigate to app > java > your app’s package name > MainActivity file and add the below code to it. simple_list_item_1 : Each list item is a TextView object. Step 3: Working with the MainActivity file.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
