在我的应用程序中,我设置了fabric和DefaultExceptionHandler。对于相同的顺序是First Fabric初始化并启动然后设置DefaultExceptionHandler。
当抛出任何未捕获的异常时,默认异常会捕获同一个异常,并在100 ms后重新启动应用程序。此时,当活动恢复时,从结构中获取以下异常。
E/Answers: Failed to submit events task
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@b716997 rejected from java.util.concurrent.ScheduledThreadPoolExecutor@f402784[Shutting down, pool size = 1, active threads = 0, queued tasks = 1, completed tasks = 8]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2049)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:814)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:305)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533)
at java.util.concurrent.ScheduledThreadPoolExecutor.submit(ScheduledThreadPoolExecutor.java:635)
at java.util.concurrent.Executors$DelegatedExecutorService.submit(Executors.java:601)
at com.crashlytics.android.answers.AnswersEventsHandler.executeAsync(AnswersEventsHandler.java:185)
at com.crashlytics.android.answers.AnswersEventsHandler.processEvent(AnswersEventsHandler.java:171)
at com.crashlytics.android.answers.AnswersEventsHandler.processEventAsync(AnswersEventsHandler.java:47)
at com.crashlytics.android.answers.SessionAnalyticsManager.onLifecycle(SessionAnalyticsManager.java:129)
at com.crashlytics.android.answers.AnswersLifecycleCallbacks.onActivityStarted(AnswersLifecycleCallbacks.java:26)
at io.fabric.sdk.android.ActivityLifecycleManager$ActivityLifecycleCallbacksWrapper$1.onActivityStarted(ActivityLifecycleManager.java:111)
at android.app.Application.dispatchActivityStarted(Application.java:207)
at android.app.Activity.onStart(Activity.java:1194)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:595)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1270)
at android.app.Activity.performStart(Activity.java:6689)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2622)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
E/Answers: Failed to submit events task
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@7d90833 rejected from java.util.concurrent.ScheduledThreadPoolExecutor@f402784[Shutting down, pool size = 1, active threads = 0, queued tasks = 1, completed tasks = 8]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2049)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:814)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:305)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533)
at java.util.concurrent.ScheduledThreadPoolExecutor.submit(ScheduledThreadPoolExecutor.java:635)
at java.util.concurrent.Executors$DelegatedExecutorService.submit(Executors.java:601)
at com.crashlytics.android.answers.AnswersEventsHandler.executeAsync(AnswersEventsHandler.java:185)
at com.crashlytics.android.answers.AnswersEventsHandler.processEvent(AnswersEventsHandler.java:171)
at com.crashlytics.android.answers.AnswersEventsHandler.processEventAsync(AnswersEventsHandler.java:47)
at com.crashlytics.android.answers.SessionAnalyticsManager.onLifecycle(SessionAnalyticsManager.java:129)
at com.crashlytics.android.answers.AnswersLifecycleCallbacks.onActivityResumed(AnswersLifecycleCallbacks.java:31)
at io.fabric.sdk.android.ActivityLifecycleManager$ActivityLifecycleCallbacksWrapper$1.onActivityResumed(ActivityLifecycleManager.java:116)
at android.app.Application.dispatchActivityResumed(Application.java:216)
at android.app.Activity.onResume(Activity.java:1255)
at android.support.v4.app.FragmentActivity.onResume(FragmentActivity.java:485)
at com.my.package.BaseActivity.onResume(BaseActivity.java:105)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1291)
at android.app.Activity.performResume(Activity.java:6776)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3398)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3461)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2730)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)