我是靠谱客的博主 激动钢铁侠,最近开发中收集的这篇文章主要介绍Attempt to read from field 'int android.view.View.mViewFlags' on a null object reference,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

SwipeBackActivity 滑动关闭视图 在小米4   api23  6.0手机手机滑动直接闪退

报错 如下 :

07-19 10:00:08.398 14724-14724/com.lvche.lvchedingdang E/PushFactory: getPushInstance not found push instance.
07-19 10:00:08.436 14724-14724/com.lvche.lvchedingdang E/MscSpeechLog: getMscParameter MSC return -1
07-19 10:00:08.948 14724-14802/com.lvche.lvchedingdang E/SMACK-Voe: enter JNI_OnLoad
07-19 10:00:19.147 14724-14724/com.lvche.lvchedingdang E/SysUtils: ApplicationContext is null in ApplicationStatus
07-19 10:00:19.287 14724-14724/com.lvche.lvchedingdang E/chromium: [ERROR:browser_gpu_channel_host_factory.cc(258)] Failed to init browser shader disk cache.
07-19 10:00:19.315 14724-14724/com.lvche.lvchedingdang E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
07-19 10:00:19.322 14724-15010/com.lvche.lvchedingdang E/ActivityThread: Failed to find provider info for com.google.settings
07-19 10:00:36.051 14724-14724/com.lvche.lvchedingdang E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.lvche.lvchedingdang, PID: 14724
java.lang.NullPointerException: Attempt to read from field 'int android.view.View.mViewFlags' on a null object reference
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15158)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:282)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:288)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:323)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2635)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2454)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2087)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1127)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6038)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:860)
at android.view.Choreographer.doCallbacks(Choreographer.java:672)
at android.view.Choreographer.doFrame(Choreographer.java:608)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:846)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5438)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)


引用以下正文 来源于 :

http://blog.csdn.net/u011515165/article/details/49001433


在做动画是碰到这个错误,后面发现是我在加动画图片这边也在移除动画,

[java]  view plain  copy
  1. 10-09 15:07:15.400: E/AndroidRuntime(10878): FATAL EXCEPTION: main  
  2. 10-09 15:07:15.400: E/AndroidRuntime(10878): Process: com.geometry, PID: 10878  
  3. 10-09 15:07:15.400: E/AndroidRuntime(10878): java.lang.NullPointerException: Attempt to read from field 'int android.view.View.mViewFlags' on a null object reference  
  4. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)  
  5. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.View.updateDisplayListIfDirty(View.java:14056)  
  6. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.View.getDisplayList(View.java:14084)  
  7. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)  
  8. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)  
  9. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.View.updateDisplayListIfDirty(View.java:14021)  
  10. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.View.getDisplayList(View.java:14084)  
  11. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)  
  12. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)  
  13. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.View.updateDisplayListIfDirty(View.java:14021)  
  14. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.View.getDisplayList(View.java:14084)  
  15. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)  
  16. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)  
  17. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.View.updateDisplayListIfDirty(View.java:14021)  
  18. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.View.getDisplayList(View.java:14084)  
  19. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:266)  
  20. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:272)  
  21. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:311)  
  22. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ViewRootImpl.draw(ViewRootImpl.java:2550)  
  23. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2388)  
  24. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2019)  
  25. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1075)  
  26. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5853)  
  27. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)  
  28. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.Choreographer.doCallbacks(Choreographer.java:580)  
  29. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.Choreographer.doFrame(Choreographer.java:550)  
  30. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)  
  31. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.os.Handler.handleCallback(Handler.java:739)  
  32. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.os.Handler.dispatchMessage(Handler.java:95)  
  33. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.os.Looper.loop(Looper.java:135)  
  34. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at android.app.ActivityThread.main(ActivityThread.java:5336)  
  35. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at java.lang.reflect.Method.invoke(Native Method)  
  36. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at java.lang.reflect.Method.invoke(Method.java:372)  
  37. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)  
  38. 10-09 15:07:15.400: E/AndroidRuntime(10878):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)  
解决办法


new Handler().post(new Runnable() {
public void run() {
parent.removeView(imageView);
}
});

最后

以上就是激动钢铁侠为你收集整理的Attempt to read from field 'int android.view.View.mViewFlags' on a null object reference的全部内容,希望文章能够帮你解决Attempt to read from field 'int android.view.View.mViewFlags' on a null object reference所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(62)

评论列表共有 0 条评论

立即
投稿
返回
顶部