只需单击一个简单的按钮,我就从我的应用程序中收到了一些错误消息。单击后动画应该开始,但按钮变得更大。它在大多数设备上都能完美运行,但在某些设备上(我认为主要是 4.X 及更高版本)它会崩溃。
异常消息(堆栈跟踪):
java.lang.NullPointerException
at android.view.GLES20RecordingCanvas.drawBitmap(GLES20RecordingCanvas.java:118)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:400)
at android.view.View.draw(View.java:10999)
at android.view.ViewGroup.drawChild(ViewGroup.java:3186)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2788)
at android.view.ViewGroup.drawChild(ViewGroup.java:3184)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2788)
at android.view.ViewGroup.drawChild(ViewGroup.java:3184)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2788)
at android.view.ViewGroup.drawChild(ViewGroup.java:3184)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2788)
at android.view.View.draw(View.java:11017)
at android.view.View.getDisplayList(View.java:10444)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2896)
at android.view.View.getDisplayList(View.java:10407)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2896)
at android.view.View.getDisplayList(View.java:10407)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2896)
at android.view.View.getDisplayList(View.java:10407)
at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:883)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2089)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1781)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2666)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:4977)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
提前致谢!