I tried to create a list of maps. In the following code, I\'m expecting to get
[{start=1,text=ye}, {start=2,text=no}]
however, I only got
When you put the same key name in the map then values will be overridden to same key. suppose we have
mMap.put("start",1);
mMap.put("start",2);
mMap.put("start",3);
mMap.put("start",4);
it will not make map of length 4, as the key("start") is same so it will override the values on the same key. so you will get the get only one value (4) against "start" key. To avoid this you will have to change the name of keys in a hashmap but in your scenaro, you need an other instance of hashmap to save the key and values as you are maintaining the arralist.