Is it possible to make a sealed class parcelable? I’ve annotated the child classes with `@Parcelize`but when I add the annotation to the parent, I get an error saying “Parcelable should not be a ‘sealed’ or ‘abstract’ class”
b
bezrukov
05/06/2020, 2:45 PM
it's possible, you need to annotate each member with
@Parcelize
bezrukov
05/06/2020, 2:46 PM
it will be
Copy code
sealed A: Parcelable {
@Parcelize data B(val b: Int): A()
@Parcelize object C : A()
}