How to make a class with nested objects Parcelable

前端 未结 7 715
梦如初夏
梦如初夏 2020-12-04 12:08

I\'d like to make class A Parcelable.

public class A {
    public String str;
    public ArrayList list;
}

This is what I\'ve come

相关标签:
7条回答
  • 2020-12-04 13:10

    I was unfortunately using a class (BarEntry) from a 3rd party library which was not able to be parceled. I solved my problem by passing through Intent an array of floats and then reconstructing my BarEntry objects at the receiving end.

    This is sub-optimal but it can be a useful process if anyone has a similar circumstance where creating a parcel able object is not an option.

    0 讨论(0)
提交回复
热议问题