I am trying to send a custom object from one activity to another activity, but it’s crashing when I call the start activity.
Below is the snippet I used.
My Activity implements Serializable
ArrayList<CUSTOM_OBJECT> Cus_Obje_arraylist = new ArrayList<CUSTOM_OBJECT>();
Here is my intent :
Intent inte = new Intent(getApplicationContext(), ListActivity.class); `
inte.putExtra("list",Cus_Obje_arraylist);`
startActivity(inte);
Please let me know why it’s crashing or what alternate way I can use?
I can give a suggestion. I do this in my project.
1.Implement a singleton class as the bridge to pass object. (Hopefully you know what’s singleton, I you don’t, add comment to tell me.
2.In the from activity,
3.Then in the to activity, you can get it from the bridge class.