I put hashmap of arraylist extra in old intent (SaleActivity)
Intent newActivity = new Intent(SaleActivity.this,UpdateActivity.class);
newActivity.putExtra("saleArrList", saleArrList);
startActivity(newActivity);
Then, I get it from newactivity (UpdateActivity)
Intent intent= getIntent();
final ArrayList<HashMap<String, String>> saleArrList = intent.get...Extra("saleArrList");
What code in … ,that i should use. Thanks for all answer a lots.
When you put the extra, it treated your array list as a
Serializable. You should use:Unfortunately, casting this to
ArrayList<HashMap<String,String>>will generate a compiler warning about unchecked conversions. This is due to how type erasure works in Java. There’s no clean and easy way to get rid of this warning. The unclean way is to suppress the warning by puttingat the top of your method. This suppresses all unchecked conversion warnings, so it is not particularly safe. However, you can then write: