ListView listView1 = findViewById(R.id.listView1);
List<HashMap<String, String>> list = new ArrayList<>();
for (int i = 0; i < 50; i++) {
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("Id", "ID " + i);
hashMap.put("Value", "Value = " + i);
list.add(hashMap);
}
SimpleAdapter adapter = new SimpleAdapter(
this,
list, // 表示 List
android.R.layout.simple_expandable_list_item_2,
new String[]{"Id", "Value"}, // hashMapの Key
new int[]{android.R.id.text1, android.R.id.text2}
);
listView1.setAdapter(adapter);