How can I pass a Object: ArrayList from one Activity to another?
Seems that intent cannot hold custom ones except ArrayList.
As a kind of hack, I use a static member:
staticResultList = new ArrayList<SingleExamResult>(m_examResults);
and Get it in the following Activity by:
m_examResults = DoExam.staticResultList;
It's not the correct way obviously, any 'common' approaches? Thanks a lot!
If you want to avoid using the static member hack, your custom class, SingleExamResult
, must implement the Parcelable
interface:
http://developer.android.com/reference/android/os/Parcelable.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With