当activiy execute 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) }
问题是破坏活动还是破坏我的PushReceiver?
最佳答案
在你的应用程序中有一个广播接收器。
BroadcastReceiver中的onReceive()方法的工作时间超过10秒,但必须提前完成(请注意,BroadcastReceiver的onReceive()是在主应用程序线程上调用的)
关于android - 崩溃后出现ANR错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34100940/