I have 2 elements tags which i want to add to 2 edittexts of a listview.
How do i do that?
String[] from = new String[] {"col_1", "col_2"};
int[] to = new int[] { R.id.editText1, R.id.editText2 };
List<HashMap<String, String>> fillMaps = new ArrayList<HashMap<String, String>>();
HashMap<String, String> map;
Document doc = Jsoup.parse(test);
Elements tdsFromSecondColumn = doc.select("td:eq(0)");
Elements tdsFromSecondColumn1 = doc.select("td:eq(1)");
for (Element tdFromSecondColumn: tdsFromSecondColumn) {
map = new HashMap<String, String>();
map.put("col_1", tdFromSecondColumn.text());
map.put("col_2", ?????);
fillMaps.add(map);
SimpleAdapter adapter = new SimpleAdapter(AndroidLogin.this, fillMaps, R.layout.test, from, to);
kp.setAdapter(adapter);
For that i would suggest you to create custom adapter for your ListView.
You know why i suggest to create a custom adapter? Just because of its one time practice, one you do it perfectly then it will be useful for any kind of ListView in future.
For creating a custom adapter for ListView, follow the below steps: