0

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!

Enzokie
  • 7,365
  • 6
  • 33
  • 39
Andriy Antonov
  • 1,360
  • 2
  • 15
  • 29
  • Why not simply create a method that encapsulates the logic that you do not want to repeat? – CommonsWare May 12 '18 at 11:59
  • As I know there is no way to set 2 or more classLoader to Bundle at the same time... Even if it is, but it'not, it doesn't make sense if there is way to do it once per all app. – Andriy Antonov May 12 '18 at 13:54

0 Answers0