A
First of all, please note that in the line:myList.add((HashMap<String, String>) hmap);
You put all the HashMap on the list, not one line. That may be what you need, but it's likely that you were planning on keeping one record here.Now look at the cycle you fill HashMap. On each internal cycle you place the current meaning of the Date and Name keys. And this is repeated on every external cycle iteration. I mean, first you put the name on the key, Moskow, then Kiev, and so on to Piter. And the key for each iteration changed to current and kept the final value when the cycles came out. And while you put HashMap in the List at every step, it's still the same reference as your log.UPDATE:If you're required to keep HashMap on the List, you're gonna need to re-establish it on every external cycle: for (int i = 0; i < jsonArray.length(); i++) {
JSONObject objectInArray = jsonArray.getJSONObject(i);
Iterator key = objectInArray.keys();
// !!!
hmap = new HashMap<String, String>();
// !!!
while (key.hasNext()) {
String k = key.next().toString();
hmap.put(k,objectInArray.getString(k));
}
myList.add((HashMap<String, String>) hmap);
}