0

I've got data class that contains variable of type PagedList?. This class needs to implement Parcelable because I want to save its state inside my Bundle.

How can I parcel objects of this type? @Parcelize doesn't help. How can I write a custom Parceler for PagedList? Or maybe there's another way by some kind of object wrapping?

Denathan
  • 141
  • 10

1 Answers1

0

You just have to give annotation @Parcelize on the class and extend that class to Parcelable and if any property of that class having Another class then that class also should be Parcelable.

And if you getting some error or something wrong then please let me know in comments.

Dipakk Sharma
  • 976
  • 1
  • 8
  • 11
  • Yes, I'm using `@Parcelize` annotation but currently, I have a problem with the class that isn't created by me. I'm using `Paging library` which is part of `Android Jetpack`. I can't extend it by `Parcelable`. I'm getting an error `Type is not directly supported by `Parelize`." – Denathan Apr 15 '19 at 08:01
  • Yeah. You cannot make Parcelable Class if it is not a model class. Can you please provide a screenshot or more detail about which class you are trying to make Parcelable. – Dipakk Sharma Apr 15 '19 at 08:06