android bug 空指针 求什么问题引起的
java.lang.NullPointerExceptionatandroid.view.ViewGroup.dispatchGetDisplayList(ViewGro...
java.lang.NullPointerException
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3055)
at android.view.View.getDisplayList(View.java:12775)
at android.view.View.getDisplayList(View.java:12880)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3060)
at android.view.View.getDisplayList(View.java:12775)
at android.view.View.getDisplayList(View.java:12880)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3060)
at android.view.View.getDisplayList(View.java:12775)
at android.view.View.getDisplayList(View.java:12880)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3060)
at android.view.View.getDisplayList(View.java:12775)
at android.view.View.getDisplayList(View.java:12880)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3060)
at android.view.View.getDisplayList(View.java:12775)
at android.view.View.getDisplayList(View.java:12880)
at android.view.HardwareRenderer$GlRenderer.buildDisplayList(HardwareRenderer.java:1411)
at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1359)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2372)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2244)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1877)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1009)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5544)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
at android.view.Choreographer.doCallbacks(Choreographer.java:562)
at android.view.Choreographer.doFrame(Choreographer.java:532)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5166)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561)
at dalvik.system.NativeStart.main(Native Method) 展开
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3055)
at android.view.View.getDisplayList(View.java:12775)
at android.view.View.getDisplayList(View.java:12880)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3060)
at android.view.View.getDisplayList(View.java:12775)
at android.view.View.getDisplayList(View.java:12880)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3060)
at android.view.View.getDisplayList(View.java:12775)
at android.view.View.getDisplayList(View.java:12880)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3060)
at android.view.View.getDisplayList(View.java:12775)
at android.view.View.getDisplayList(View.java:12880)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3060)
at android.view.View.getDisplayList(View.java:12775)
at android.view.View.getDisplayList(View.java:12880)
at android.view.HardwareRenderer$GlRenderer.buildDisplayList(HardwareRenderer.java:1411)
at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1359)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2372)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2244)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1877)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1009)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5544)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
at android.view.Choreographer.doCallbacks(Choreographer.java:562)
at android.view.Choreographer.doFrame(Choreographer.java:532)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5166)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561)
at dalvik.system.NativeStart.main(Native Method) 展开
1个回答
2015-09-04 · 知道合伙人软件行家
关注
展开全部
空指针 java.lang.NullPointerException
常见的几种原因是:
对象未初始化而直接引用对象值或者方法到的
对象引用已经不存在或者被JDBC关闭
一个经典的例子是JDBC connection已经关闭,ResultSet对象仍然被使用中,这个时候NullPointerException就被抛出。
违反某些Java容器的限制,读写Null 值
例如 java.util.HashTable,它不接受Null 作为Key或者Value,如果试图用Null作为Key去读取HashTable将会得到NullPointerException
Java NullPointerException做为Java Runtime 异常,在开发中减少这样错误的发生就是对代码完成Junit的单元测试,对于一些重要的代码要提高code review的次数从而提高代码质量。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询