Android: How to pass ArrayList <customObject> between actions?

How to pass an object: ArrayList from one action to another?

It seems that the intent cannot contain custom except ArrayList.

As a kind of hack, I use a static member:

staticResultList = new ArrayList<SingleExamResult>(m_examResults);

and get it in the following Office:

m_examResults = DoExam.staticResultList;

This is not the right way, obviously, some kind of "general" approaches? Many thanks!

+5
source share
1 answer

If you want to avoid using static element hacking, your custom class SingleExamResultshould implement an interface Parcelable:

http://developer.android.com/reference/android/os/Parcelable.html

+2
source

All Articles