I'm trying to add subItems in my ListView. My listView should be organized with emails for items and their institution for the subitems, but with the following code I just added items, how can I add my subitems on it? I've tried so many things but it doesn't work.
List<Login> listEmails = JsonUtil.getAllEmails(json); ArrayList<String> emails = new ArrayList<String>(); ArrayList<String> institutions = new ArrayList<String>(); for (Login loginObj : listEmails) { emails.add(loginObj.getEmailAndress()); } for (Login loginObj : listEmails) { institutions.add(loginObj.getInstitution()); } ArrayAdapter<String> adapter; adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, emails); emailListView.setAdapter(adapter);