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

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.NullPointerException
07-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.NullPointerException
07-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)

BIG阳
浏览 531回答 2
2回答

郎朗坤

检查下Activity onCreate里面的方法有没有写错,不行clean下,还不行,重启eclipse试试
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java