为了账号安全,请及时绑定邮箱和手机立即绑定

用Eclipse开发android 应用时,在logcat里出现了fatal exception

用Eclipse开发android 应用时,在logcat里出现了fatal exception

BIG阳 2019-03-22 23:19:43
logcat 如下:07-29 13:44:35.140: E/AndroidRuntime(375): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.zhinengdiancan/com.zhinengdiancan.MainActivity}: java.lang.NullPointerException07-29 13:44:35.140: E/AndroidRuntime(375): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1736)07-29 13:44:35.140: E/AndroidRuntime(375): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752)07-29 13:44:35.140: E/AndroidRuntime(375): at android.app.ActivityThread.access$1500(ActivityThread.java:123)07-29 13:44:35.140: E/AndroidRuntime(375): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993)07-29 13:44:35.140: E/AndroidRuntime(375): at android.os.Handler.dispatchMessage(Handler.java:99)07-29 13:44:35.140: E/AndroidRuntime(375): at android.os.Looper.loop(Looper.java:126)07-29 13:44:35.140: E/AndroidRuntime(375): at android.app.ActivityThread.main(ActivityThread.java:3997)07-29 13:44:35.140: E/AndroidRuntime(375): at java.lang.reflect.Method.invokeNative(Native Method)07-29 13:44:35.140: E/AndroidRuntime(375): at java.lang.reflect.Method.invoke(Method.java:491)07-29 13:44:35.140: E/AndroidRuntime(375): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)07-29 13:44:35.140: E/AndroidRuntime(375): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)07-29 13:44:35.140: E/AndroidRuntime(375): at dalvik.system.NativeStart.main(Native Method)07-29 13:44:35.140: E/AndroidRuntime(375): Caused by: java.lang.NullPointerException07-29 13:44:35.140: E/AndroidRuntime(375): at com.zhinengdiancan.MainActivity.LoadUserdata(MainActivity.java:222)07-29 13:44:35.140: E/AndroidRuntime(375): at com.zhinengdiancan.MainActivity.onCreate(MainActivity.java:67)07-29 13:44:35.140: E/AndroidRuntime(375): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
查看完整描述

2 回答

?
郎朗坤

TA贡献1921条经验 获得超9个赞

检查下Activity onCreate里面的方法有没有写错,不行clean下,还不行,重启eclipse试试


查看完整回答
反对 回复 2019-04-29
  • 2 回答
  • 0 关注
  • 530 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信