Parcelable objects?


Is there any plan in the future for support for parcelable objects, I currently use the charting as two child fragments inside a parent fragment and thus setRetainInstance doesn’t work.

As such things like DateRange, Series etc are not parcelable making rotation a bigger pain.


Hi Michael,

Thanks very much for posting. It’s a good question and is something we have considered but the short answer is we don’t currently have any plans to do this.

The longer answer is that as the ChartView is a pretty complex control the range of different things that users may or may not want (or expect) to be preserved over configuration changes would vary hugely depending on their use case. As such we put this burden onto the user, especially in the light of also providing the ChartFragment which does preserve the chart over configuration changes (though I realise in your case it’s not possible to use this due to the setRetainInstance issue for nested Fragments).

In practice I would imagine in most use cases the main thing needing to be preserved across configuration changes would be the axis ranges, and doing so shouldn’t be too much work especially when you know exactly how many axes the chart has etc. Don’t get me wrong though, I can understand that it’s a pain to have to handle this yourself when most Views you work with do it automatically!

I will certainly make a note of this in our backlog as we do base our future development on customer feedback though I would also have to be honest and say this isn’t something that has been requested much at all.

Hope that makes sense but do come back to us if you have any further questions.

Kind regards,