yuxinburen / achartengine

Automatically exported from code.google.com/p/achartengine
0 stars 0 forks source link

Fails at put AbstractChart into Bundle using putSerializable #101

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Through a series of modifications, I use a GraphicalView which will inflate 
in the onCreate() of my main activity. This view takes an AbstractChart as an 
argument.

2. When going onSaveInstanceState(), the AbstractChart is saved into a bundle 
using putSerializable.

protected void onSaveInstanceState(Bundle outState){
               //ChartFactory.CHART is the key
               //getChart() returns the chart drawn
outState.putSerializable(ChartFactory.Chart,mView.getChart());
super.onSaveInstanceState(outState);
}

3. Launch the activity, and wait for it to call onPause()

What is the expected output? What do you see instead?
The expected result is saving the chart into the bundle.

Instead, an exception : NotSerializaleException is thrown, because of 
android.graphics.pointF

What version of the product binary library are you using?
0.6.0

Please provide any additional information below.
Since the AbstractChart implements Serializable, it is supposed to be put into 
a bundle. Moreover, it is the same technique used for initially creating a 
GraphicalView. So why would it crash when being retrieved, but not crash when 
being put into the bundle.

PS: please let me know if you need code snippets, as different modifications of 
the original code will have to be documented.

Original issue reported on code.google.com by anas.am...@gmail.com on 17 Jul 2011 at 2:41

GoogleCodeExporter commented 9 years ago
You can eventually save the renderer and the dataset and rebuild the chart.

Original comment by dandrome...@gmail.com on 19 Jul 2011 at 6:53