Given a custom class
org.example.app.MyClass implements Parcelable
List<MyClass> myclassList = ...
List<MyClass> myclassList = new ArrayList<MyClass>();
"BadParcelableException: ClassNotFoundException when unmarshalling org.example.app.MyClass"
Don't unmarshall a custom class, i.e. one provided by your application and not by the Android framework, with the framework class loader that get's used when you give
null as Classloader argument. Use the application class loader:
Parcel.read*() method also has a ClassLoader as argument (e.g.
Parcel.readList(List outVal, ClassLoader loader)) and you want to read a application class from a
Parcel, use the application class loader that can be retrieved with
Background: Android comes with two class loaders: The system class loader, that is able to load all system classes but the the ones provided by your application. And the application class loader, which has set the system class loader as parent and therefore is able to load all classes. If you give null a class loader,
Parcel.readParcelableCreator(), will use the framework class loader, causing in the ClassNotFoundException.
Thanks to alexanderblom for providing the hint that lead me on the right track