How would you extract the data as follows:
I want to extract from this arraylist:
[{itemname=Original, number=12}, {itemname=BBQ, number=23}, {itemname=CatchUp, number=23}]
This array:
{"Original":12,"BBQ":23,"CatchUp":23}
Thanks in advance! Here's the code used to generate the hashmap:
ArrayList<HashMap<String,String>> list = new ArrayList<HashMap<String,String>>();
for (int i = 0; i<7;i++) {
HashMap<String,String> map = new HashMap<String,String>();
map.put("itemname",chips[i]);
map.put("number",chipentry[i]);
list.add(map);
}
ArrayList?