在恢复时,应用程序在android中一小时后崩溃

时间:2012-06-22 13:13:09

标签: android

我的android应用程序崩溃了,当我把它发送到后台半小时然后从家里发射。

logcat信息如下所示。

06-20 13:13:39.839: E/AndroidRuntime(23778):    ... 20 more
06-20 13:13:39.839: E/AndroidRuntime(23778): Caused by: java.lang.NullPointerException
06-20 13:13:39.839: E/AndroidRuntime(23778):    at com.globalnest.CaptureActivity.onCreate(CaptureActivity.java:116)
06-20 13:13:39.839: E/AndroidRuntime(23778):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-20 13:13:39.839: E/AndroidRuntime(23778):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
06-20 13:13:39.839: E/AndroidRuntime(23778):    ... 27 more
06-20 13:13:39.849: W/ActivityManager(255):   Force finishing activity com.globalnest/.AdminTabHost
06-20 13:13:39.869: D/dalvikvm(23778): GC_CONCURRENT freed 204K, 48% free 2898K/5511K, external 1040K/1552K, paused 3ms+14ms
06-20 13:13:40.359: W/ActivityManager(255): Activity pause timeout for HistoryRecord{2b62c908 com.globalnest/.AdminTabHost}
06-20 13:13:45.409: D/lights(255): set_light_buttons: brightness=0
06-20 13:13:46.239: D/dalvikvm(22012): GC_CONCURRENT freed 465K, 49% free 3008K/5895K, external 743K/1036K, paused 9ms+2ms
06-20 13:13:49.409: W/ActivityManager(255): Launch timeout has expired, giving up wake lock!
06-20 13:13:49.669: W/ActivityManager(255): Activity idle timeout for HistoryRecord{2b62c908 com.globalnest/.AdminTabHost}
06-20 13:13:50.389: W/ActivityManager(255): Activity idle timeout for HistoryRecord{2b59f888 com.globalnest/.Main}
06-20 13:13:55.469: D/dalvikvm(22012): GC_EXPLICIT freed 138K, 52% free 2869K/5895K, external 743K/1036K, paused 80ms
06-20 13:13:59.679: W/ActivityManager(255): Activity destroy timeout for HistoryRecord{2b62c908 com.globalnest/.AdminTabHost}
06-20 13:14:00.139: D/dalvikvm(671): GC_EXPLICIT freed 4K, 49% free 2782K/5379K, external 1404K/1557K, paused 85ms
06-20 13:14:00.199: D/dalvikvm(671): GC_EXPLICIT freed 3K, 49% free 2783K/5379K, external 1404K/1557K, paused 25ms
06-20 13:14:00.199: W/CursorWrapperInner(671): Cursor finalized without prior close()
06-20 13:14:02.419: D/lights(255): set_light_backlight: brightness=20
06-20 13:14:09.419: D/lights(255): set_light_backlight: brightness=0
06-20 13:14:09.419: I/power(255): *** set_screen_state 0
06-20 13:14:09.419: D/DASH - select(255): sensors_select_callback: select canceled by request
06-20 13:14:09.419: D/DASH - select(255): sensors_select_callback: select canceled by request
06-20 13:14:09.429: D/kernel(126): [50267.656494] request_suspend_state: sleep (0->3) at 50264074243382 (2012-06-20 07:44:09.423339839 UTC)
06-20 13:14:09.429: D/kernel(126): [50267.656616] as3676 0-0040: as3676_early_suspend
06-20 13:14:09.429: D/kernel(126): [50267.659759] cyttsp-spi spi0.0: cyttsp_suspend: Enter
06-20 13:14:09.449: D/SurfaceFlinger(255): About to give-up screen, flinger = 0x91bf8
06-20 13:14:09.919: D/kernel(126): [50268.142242] active wake lock PowerManagerService
06-20 13:14:09.919: D/kernel(126): [50268.142272] active wake lock bq24185_watchdog_lock
06-20 13:14:09.919: D/kernel(126): [50268.142272] active wake lock usb_bus_active
06-20 13:14:09.919: D/kernel(126): [50268.142272] active wake lock msm_otg
06-20 13:14:09.919: D/kernel(126): [50268.142303] wake lock msm_serial_hs_rx, expired
06-20 13:14:09.919: D/kernel(126): [50268.142303] wake lock wifi_rx_wake, expired
06-20 13:14:09.939: W/ActivityManager(255): Activity pause timeout for HistoryRecord{2b59f888 com.globalnest/.Main}
06-20 13:14:14.489: I/ActivityManager(255): Start proc com.sonyericsson.lockscreen.notifications for broadcast com.sonyericsson.lockscreen.notifications.facebook/.LockscreenReceiver: pid=23791 uid=10058 gids={3003}
06-20 13:14:14.579: I/ActivityThread(23791): Pub com.sonyericsson.lockscreen.notifications: com.sonyericsson.lockscreen.notifications.provider.NotificationProvider
06-20 13:14:14.759: D/dalvikvm(255): GC_CONCURRENT freed 499K, 39% free 8315K/13447K, external 2950K/3252K, paused 3ms+8ms
06-20 13:14:15.679: I/ActivityManager(255): Process com.sonyericsson.android.datamonitor (pid 22012) has died.
06-20 13:14:15.689: W/kernel(126): [50273.912445] select 21040 (com.aricent.mtp), adj 10, size 3198, to kill
06-20 13:14:15.689: W/kernel(126): [50273.912506] select 22012 (oid.datamonitor), adj 10, size 3567, to kill

请任何人帮助我......

告诉你。

2 个答案:

答案 0 :(得分:1)

06-20 13:13:39.839: E/AndroidRuntime(23778): Caused by: java.lang.NullPointerException
06-20 13:13:39.839: E/AndroidRuntime(23778):    at com.globalnest.CaptureActivity.onCreate(CaptureActivity.java:116)

有你的线索。查看CaptureActivity.java的第116行,找出可能意外的null

答案 1 :(得分:0)

你可以假设你的进程被Android操作系统杀死了,如果它在后台工作了半个小时。因此,当您再次启动应用程序时,Android操作系统将重新创建该过程并重新启动仅位于堆栈顶部的活动

如果堆栈顶部的Activity依赖于其他任何内容(之前可能已设置的其他活动),那么您的应用程序将崩溃。这是因为整个活动堆栈未重新创建

考虑到这一点,请回顾一下在这种情况下会发生什么。