I want to add the value like ArrayList<HashMap<String, Object>> to intent, and pass on Activity through broadc. The code like this:
ArrayList<HashMap<String, Object>> listItem = new ArrayList<HashMap<String, Object>>();
intent1.putParcelableArrayListExtra("listItem", listItem);
But it has the error:
The method
putParcelableArrayListExtra(String, ArrayList<? extends Parcelable>)in the type Intent is not applicable for the arguments(String, ArrayList<HashMap<String,Object>>)
How to use putParcelableArrayListExtra specific? Through realizing Parcelable interface, can it return the ArrayList < HashMap < String, Object > > Object?
Since ArrayList implements Serializable, you don’t have to do anything special to feed it to
Just Use
Intent.putExtra()to put the values and usegetSerializableExtra()to get the arraylist back to next activity.