申请人关闭

时间:2012-01-16 12:19:24

标签: android forceclose

这是我的logcat,问题是应用程序强制关闭,我想知道造成这种情况的行或方法。我是android的新手,所以无法理解logcat的一个词。提前致谢

01-16 17:32:56.584: D/dalvikvm(276): GC freed 596 objects / 49984 bytes in 101ms
01-16 17:33:09.233: D/AndroidRuntime(276): Shutting down VM
01-16 17:33:09.233: W/dalvikvm(276): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
01-16 17:33:09.233: E/AndroidRuntime(276): Uncaught handler: thread main exiting due to uncaught exception
01-16 17:33:09.273: E/AndroidRuntime(276): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ymappuser/com.ymappuser.Manualloc}: java.lang.RuntimeException: java.lang.NullPointerException
01-16 17:33:09.273: E/AndroidRuntime(276):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
01-16 17:33:09.273: E/AndroidRuntime(276):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
01-16 17:33:09.273: E/AndroidRuntime(276):  at android.app.ActivityThread.access$2200(ActivityThread.java:119)
01-16 17:33:09.273: E/AndroidRuntime(276):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
01-16 17:33:09.273: E/AndroidRuntime(276):  at android.os.Handler.dispatchMessage(Handler.java:99)
01-16 17:33:09.273: E/AndroidRuntime(276):  at android.os.Looper.loop(Looper.java:123)
01-16 17:33:09.273: E/AndroidRuntime(276):  at android.app.ActivityThread.main(ActivityThread.java:4363)
01-16 17:33:09.273: E/AndroidRuntime(276):  at java.lang.reflect.Method.invokeNative(Native Method)
01-16 17:33:09.273: E/AndroidRuntime(276):  at java.lang.reflect.Method.invoke(Method.java:521)
01-16 17:33:09.273: E/AndroidRuntime(276):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
01-16 17:33:09.273: E/AndroidRuntime(276):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
01-16 17:33:09.273: E/AndroidRuntime(276):  at dalvik.system.NativeStart.main(Native Method)
01-16 17:33:09.273: E/AndroidRuntime(276): Caused by: java.lang.RuntimeException: java.lang.NullPointerException
01-16 17:33:09.273: E/AndroidRuntime(276):  at com.ymappuser.Manualloc.getCountries(Manualloc.java:270)
01-16 17:33:09.273: E/AndroidRuntime(276):  at com.ymappuser.Manualloc.fillcountry(Manualloc.java:83)
01-16 17:33:09.273: E/AndroidRuntime(276):  at com.ymappuser.Manualloc.onCreate(Manualloc.java:75)
01-16 17:33:09.273: E/AndroidRuntime(276):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-16 17:33:09.273: E/AndroidRuntime(276):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
01-16 17:33:09.273: E/AndroidRuntime(276):  ... 11 more
01-16 17:33:09.273: E/AndroidRuntime(276): Caused by: java.lang.NullPointerException
01-16 17:33:09.273: E/AndroidRuntime(276):  at com.ymappuser.Manualloc.getCountries(Manualloc.java:243)
01-16 17:33:09.273: E/AndroidRuntime(276):  ... 15 more
01-16 17:33:09.384: I/dalvikvm(276): threadid=7: reacting to signal 3
01-16 17:33:09.404: I/dalvikvm(276): Wrote stack trace to '/data/anr/traces.txt'
01-16 17:33:11.353: I/Process(276): Sending signal. PID: 276 SIG: 9
01-16 17:33:13.004: D/dalvikvm(284): GC freed 623 objects / 51024 bytes in 125ms
01-16 17:34:21.646: D/dalvikvm(284): GC freed 288 objects / 14672 bytes in 987ms

1 个答案:

答案 0 :(得分:1)

你在getCountries方法中得到空指针异常,在第270行的Manualloc类中,你可以通过调试行检查那个对象是否为null来检查那里,并相应地工作。