Title says all.
Sample code:
ArrayList<HashMap<String, Object>> data = new ArrayList<HashMap<String, Object>>();
HashMap<String, Object> parentHash = new HashMap<String, Object>();
HashMap<String, String> childHash = new HashMap<String, String>();
childHash.put("child_id", "id")
childHash.put("name", "first last");
childHash.put("sex", "man");
parentHash.put("parent_id", "id");
parentHash.put("name", "first last");
parentHash.put("sex", "woman");
parentHash.put("children", childHash);
data.add(parentHash);
Everything looks okay if I print the ArrayList "data" on the screen (example):
[{parent_id=id, name=first last, sex=woman, children=[{
child_id=id, name=first last, sex=man
}]
}, {parent_id=id, name=first last, sex=woman, children=[{
child_id=id, name=first last, sex=man
}]
}];
So it's HashMap in HashMap and then in the ArrayList. I know how to retrieve value from the parent, but how do I retrieve value from the child?