I am trying to compare and update an item in a ArrayList<HashMap<String,String>>named cart.
I am doing the following:
cart_list.put("quantity", "" +5); //cart_list is HashMap<String,String>
cart_list.put("item_id", "" + 1);
cart.add(cart_list);
cart_list.put("quantity", "" +6); //cart_list is HashMap<String,String>
cart_list.put("item_id", "" + 1);
cart_list.put("prefernces", "no salt");
cart.add(cart_list);
I want to update the 'preferencesfromno salttoxtra salt`. Can anyone tell me step by step how to do it?
preferencesvalue in the ArrayList. But the problem is that they have the sameitem_idi.e 1. So i am not able to figure out how to proceed.