Shamim1977 / achartengine

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

Crashes when minimizing the app and miximizing it again. #443

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Note: I didn't render the GraphicalView from the GraphicalActivity (i.e  not 
using setcontentView(View)) but i'm using fragment to render the GraphicalView 
for my activity.
What steps will reproduce the problem?
1. Initialized the Bar chart.
2. get the intent from the chartFactory.
3. started my own Activity (named ActivityX) with this intent (not 
GraphicalActivity).
4. In ActivityX, I instantiate the fragment to render the GraphicalView.
5. Now run the App, see the BarChart View is rendered properly.
6. Now minimize the app and maximize it again. you will see the crash.

Please see the attached files to see the crash logs.
I'm able to see these lines from crash logs :

1. Caused by: java.io.NotSerializableException: 
org.achartengine.chart.ClickableArea 

2. java.lang.RuntimeException: Parcelable encountered IOException writing 
serializable object (name = org.achartengine.chart.BarChart)

Note : I know i didn't use the GraphicalActivity to show the chart. But please 
hep me with this one. I really need fragment to show the chart.

What is the expected output? What do you see instead?
It should not crash and render the graph properly.

Please provide a source code snippet that we can use to replicate the
issue.
From My Custom Activity :
========================
    BarGraph bar = new BarGraph();
    Intent intent = bar.getIntent(this);
    // fragment instantiated in oncreate()  of this activity.
    fragment.setArguments(intent.getExtras());
    getFragmentManager().beginTransaction().replace(R.id.frame_container, fragment).commit();
==========================================
From My Custom Fragment :
============================
In My Fragment, I only written this. all other life cycle methods are left with 
default implementation.

     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        Bundle extras = getArguments();
        mChart = (AbstractChart) extras.getSerializable(ChartFactory.CHART);
        mView = new GraphicalView(getActivity(), mChart);
        title = extras.getString(ChartFactory.TITLE);
        return mView;
     }
========================
What version of the product binary library are you using?
1.2.0

Please provide any additional information below.

Original issue reported on code.google.com by pavankum...@gmail.com on 11 Oct 2014 at 2:24

Attachments: