i tried so many things to do this, but still cant add more arraylist
please help me.
this is my code :
public static ArrayList<HashMap<String, String>> cartList;
cart.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
// Get the position from the results
HashMap<String, String> resultp = new HashMap<String, String>();
resultp = data.get(position);
cartList = new ArrayList<HashMap<String, String>>();
HashMap<String, String> map = new HashMap<String, String>();
map.put("nama", resultp.get(SellerActivity.TITLE));
map.put("harga", resultp.get(SellerActivity.HARGA));
map.put("link_gambar", resultp.get(SellerActivity.WEBSITE));
map.put("website", resultp.get(SellerActivity.GAMBAR));
cartList.add(map);
}
});
i want the output is list of my arraylist, but on this situation i just can add one array. thanks..
UPDATE :
now i want to add checkbox and button to delete item from arraylist, have a clue with that?