崩溃后的ANR错误

时间:2015-12-05 03:30:34

标签: android

当Activiy执行Oncreate时,我将Activity添加到activityStack。 崩溃。完成UncaughtExceptionHandler中的所有活动。

public void finishAllActivity() {
    Activity activity;
    while(!activityStack.empty()){
        activity = activityStack.pop();
        activity.finish();
    }
}

日志:

12-05 10:35:38.515: D/testException(13404): com.orimuse.android.activity.message.FirendCircleActivity finish!
12-05 10:35:38.517: D/testException(13404): com.orimuse.android.activity.homepage.MainActivity_ finish!
12-05 10:35:39.017: W/ActivityManager(752): Activity pause timeout for ActivityRecord{39eba0cf u0 com.orimuse.android/.activity.message.FirendCircleActivity t2550 f}
12-05 10:35:40.029: W/PackageManager(1499): Failure retrieving resources for com.orimuse.android: Resource ID #0x0
12-05 10:35:48.525: W/ActivityManager(752): Activity destroy timeout for ActivityRecord{21cd14af u0 com.orimuse.android/.activity.homepage.MainActivity_ t2550 f}
12-05 10:35:49.381: W/ActivityManager(752): Activity destroy timeout for ActivityRecord{39eba0cf u0 com.orimuse.android/.activity.message.FirendCircleActivity t2550 f}
12-05 10:36:11.756: E/WifiStateMachine(752): WifiStateMachine starting scan for "orimuse-5"WPA_PSK with 5745,2412
12-05 10:36:31.762: E/WifiStateMachine(752): WifiStateMachine starting scan for "orimuse-5"WPA_PSK with 5745,2412
12-05 10:36:38.896: W/BroadcastQueue(752): Receiver during timeout: ResolveInfo{26e76784 com.orimuse.android/.activity.xg.MyPushReceiver m=0x108000}
12-05 10:36:43.186: E/ActivityManager(752): ANR in com.orimuse.android
12-05 10:36:43.186: E/ActivityManager(752): Reason: Broadcast of Intent { act=com.tencent.android.tpush.action.FEEDBACK flg=0x10 pkg=com.orimuse.android cmp=com.orimuse.android/.activity.xg.MyPushReceiver (has extras) }

问题在于销毁活动或MyPushReceiver?

1 个答案:

答案 0 :(得分:3)

在你的应用中有一个BroadcastReceiver。

BroadcastReceiver中的onReceive()方法工作时间超过10秒,但必须提前完成(请注意,在主应用程序线程上调用BroadcastReceiver的onReceive())