我的Android应用程序经常在启动时崩溃,并提供以下异常:
05-31 01:36:26.989: E/AndroidRuntime(13825): FATAL EXCEPTION: main
05-31 01:36:26.989: E/AndroidRuntime(13825): java.lang.NullPointerException
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.ViewGroup.resolveTextAlignment(ViewGroup.java:5318)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.View.resolveRtlPropertiesIfNeeded(View.java:11591)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.ViewGroup.resolveRtlPropertiesIfNeeded(ViewGroup.java:5262)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.ViewGroup.resolveRtlPropertiesIfNeeded(ViewGroup.java:5267)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.ViewGroup.resolveRtlPropertiesIfNeeded(ViewGroup.java:5267)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.ViewGroup.resolveRtlPropertiesIfNeeded(ViewGroup.java:5267)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.View.setLayoutDirection(View.java:5901)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1190)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.Choreographer.doFrame(Choreographer.java:532)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.os.Handler.handleCallback(Handler.java:725)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.os.Handler.dispatchMessage(Handler.java:92)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.os.Looper.loop(Looper.java:137)
05-31 01:36:26.989: E/AndroidRuntime(13825): at android.app.ActivityThread.main(ActivityThread.java:5041)
05-31 01:36:26.989: E/AndroidRuntime(13825): at java.lang.reflect.Method.invokeNative(Native Method)
05-31 01:36:26.989: E/AndroidRuntime(13825): at java.lang.reflect.Method.invoke(Method.java:511)
05-31 01:36:26.989: E/AndroidRuntime(13825): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-31 01:36:26.989: E/AndroidRuntime(13825): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
05-31 01:36:26.989: E/AndroidRuntime(13825): at dalvik.system.NativeStart.main(Native Method)
它似乎没有在异常中引用我的代码,这使得调试非常困难。我是Android开发的新手(但在iOS开发方面经验丰富)。任何想法,这个异常意味着什么以及如何解决它?它只会在启动时发生。
谢谢!
答案 0 :(得分:0)
powerj1984:D'哦,是的,你是对的。在后台线程上,我调用了一个更新底部UI的方法(忘记了)。谢谢你的帮助,你摇滚。