Am having an arraylist
ArrayList<HashMap<String, String>> arraylist;
and am adding json data to this arraylist to populate in listview later, using hashmap in the below format
int ja=jsonarray.length();
for (int i = 0; i <= ja; i++) {
HashMap<String, String> map = new HashMap<String, String>();
jsonobject = jsonarray.getJSONObject(i);
// Retrive JSON Objects
map.put("slno", jsonobject.getString("slno"));
map.put("mark", jsonobject.getString("mark"));
// Set the JSON Objects into the array
arraylist.add(map);
}
the problem is I want to calculate all the mark values and populate in a textview as total marks. how shall I achieve this?