ArrayList<HashMap<String, Object>> list = new ArrayList<HashMap<String, Object>>();for (int j = 0; j < 3; j++) list.add(null);HashMap<String, Object> map = new HashMap<String, Object>();map.put("name", "jim");map.put("year", 2009); list.add(2, map); ListView listview = (ListView)findViewById(R.id.listview); listview.setAdapter(new SimpleAdapter(MainActivity.this, list, R.layout.item, new String[]{"name","year"}, new int[]{R.id.name,R.id.year}) { });