ibrahimsaputra / achartengine

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

crashes if phone is in landscape #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. hold phone sideways
2. load a graph
3.

What is the expected output? What do you see instead? I expect a graph but 
instead I get force close

Please provide a source code snippet that we can use to replicate the issue.
        String[] titles = new String[] { "" };

        int[] colors = new int[] { Color.BLUE };
        PointStyle[] styles = new PointStyle[] { PointStyle.POINT };
        XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
        // try catch to keep it from crashing if values are null
        try{
        setChartSettings(renderer, "", "Time", Units, dateValues[0].getTime(),
                dateValues[dateValues.length - 1].getTime() , MIN - .2, MAX + .2, Color.GRAY, Color.LTGRAY);
        } catch (Exception e) {
            e.printStackTrace();
        }
        renderer.setYLabels(8);
        renderer.setXLabels(4);
        Intent intent = ChartFactory.getTimeChartIntent(this, buildDateDataset(titles, dates, values),
                renderer,  "MM/dd hh:mm aa");
        startActivity(intent);

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

Please provide any additional information below.

Original issue reported on code.google.com by opy...@gmail.com on 18 Dec 2010 at 5:17

GoogleCodeExporter commented 9 years ago
I forgot to say that I can load the graph in portrait just fine and once the 
graph is loaded I can change to landscape and it works fine.

Original comment by opy...@gmail.com on 18 Dec 2010 at 5:19

GoogleCodeExporter commented 9 years ago
Here is the stack trace

java.lang.IllegalArgumentException: View not attached to window manager
at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355)
at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200)
at android.view.Window$LocalWindowManager.removeView(Window.java:432)
at android.app.Dialog.dismissDialog(Dialog.java:278)
at android.app.Dialog.access$000(Dialog.java:71)
at android.app.Dialog$1.run(Dialog.java:111)
at android.app.Dialog.dismiss(Dialog.java:268)
at mymobile.reef.CsvParser$1.handleMessage(CsvParser.java:327)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)

--------------------------------------------------------------------------------

Original comment by opy...@gmail.com on 18 Dec 2010 at 5:36

GoogleCodeExporter commented 9 years ago
The source code you provided is really not helping replicate the eventual bug.
Please download the current code snapshot here: 
http://groups.google.com/group/achartengine and if you can still replicated, 
please post some code that I can use to replicate the bug.

Original comment by dandrome...@gmail.com on 3 Jan 2011 at 2:09

GoogleCodeExporter commented 9 years ago
I added graphing to my other app and it seems to be fine in both landscape or 
normal.  Odd thing is I used the same code but I just am not pulling data from 
a csv file online, I am pulling it directly from user entered data in a DB.  
Maybe its the way I am downloading the data and when it switches views the 
strings reset.  I'll change a few things and if it still does it I'll get you 
some more code.  It's probly a user error though lol.  Thanks.

Original comment by opy...@gmail.com on 3 Jan 2011 at 2:47