我从这里下载了 achartengine 演示:http ://code.google.com/p/achartengine/downloads/list 在我开始演示之后,我发现并不是每个图表都按预期绘制,当我点击预算饼图时,它没有用,这是我的日志:
06-11 17:48:31.478: D/AndroidRuntime(1909): Shutting down VM
06-11 17:48:31.478: W/dalvikvm(1909): threadid=1: thread exiting with uncaught exception (group=0x40a221f8)
06-11 17:48:31.518: E/AndroidRuntime(1909): FATAL EXCEPTION: main
06-11 17:48:31.518: E/AndroidRuntime(1909): java.lang.NullPointerException
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.GLES20Canvas.drawBitmap(GLES20Canvas.java:692)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.GLES20RecordingCanvas.drawBitmap(GLES20RecordingCanvas.java:103)
06-11 17:48:31.518: E/AndroidRuntime(1909): at org.achartengine.GraphicalView.onDraw(GraphicalView.java:174)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.View.draw(View.java:10982)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.View.getDisplayList(View.java:10421)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.View.draw(View.java:10985)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.widget.FrameLayout.draw(FrameLayout.java:450)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.View.getDisplayList(View.java:10421)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.View.getDisplayList(View.java:10419)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.View.draw(View.java:10985)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.widget.FrameLayout.draw(FrameLayout.java:450)
06-11 17:48:31.518: E/AndroidRuntime(1909): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2126)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.View.getDisplayList(View.java:10421)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:840)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.ViewRootImpl.draw(ViewRootImpl.java:1935)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1659)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2467)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.os.Handler.dispatchMessage(Handler.java:99)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.os.Looper.loop(Looper.java:137)
06-11 17:48:31.518: E/AndroidRuntime(1909): at android.app.ActivityThread.main(ActivityThread.java:4424)
06-11 17:48:31.518: E/AndroidRuntime(1909): at java.lang.reflect.Method.invokeNative(Native Method)
06-11 17:48:31.518: E/AndroidRuntime(1909): at java.lang.reflect.Method.invoke(Method.java:511)
06-11 17:48:31.518: E/AndroidRuntime(1909): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
06-11 17:48:31.518: E/AndroidRuntime(1909): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
06-11 17:48:31.518: E/AndroidRuntime(1909): at dalvik.system.NativeStart.main(Native Method)
我无法在代码中捕获异常详细信息,可能是因为异常没有发生在主线程中。有人有同样的经历吗?欢迎任何相关的答案,提前谢谢!