Andriy Antonov
Andriy Antonov

Reputation: 1510

How to add custom class to system classLoader?

I have two custom classes:

class A: Parcelable{} class B: Parcelable{}

When I save and restore them (during rotation) at each place I need set classLoader to Bundle. Otherwise I will get BadParcelableException: ClassNotFoundException when unmarshalling

Also I need compare content of two bundles and here it looks dirty to set custom classLoader aech time... So I am pretty sure that there is some way to add custom classes to system classLoader (or something similar action) so this problem can be solved on application level, but not locally.

Will be glad any help!

Upvotes: 0

Views: 178

Answers (0)

Related Questions