Closed daberni closed 9 years ago
I have a problem with generic lists in subclasses, where superclass and inherited class both are @Parcelable
I added a testcase https://github.com/daberni/SwissKnife/commit/f6d0023b5030b4c7b8a40efe9de675a0d9e169f0
public class BetterPerson extends Person { String someotherProperty List<Person> children = [] }
the problem is, that the wrong classloader is used, when reading list from parcel generated code:
public BetterPerson(Parcel parcel) { super(parcel); List localList = ScriptBytecodeAdapter.createList(new Object[0]); this.children = localList; String str = parcel.readString(); this.someotherProperty = str; parcel.readList(this.children, List.class.getClassLoader()); null; }
instead of List Person should get used as reference for getClassLoader()
List
Person
getClassLoader()
when the List-member is added in the super class Person everything is fine
Could you try this branch? https://github.com/Arasthel/SwissKnife/tree/parcelablelisttest
fixed the issue
Nice!
I have a problem with generic lists in subclasses, where superclass and inherited class both are @Parcelable
I added a testcase https://github.com/daberni/SwissKnife/commit/f6d0023b5030b4c7b8a40efe9de675a0d9e169f0
the problem is, that the wrong classloader is used, when reading list from parcel generated code:
instead of
List
Person
should get used as reference forgetClassLoader()
when the List-member is added in the super class
Person
everything is fine