0

In Android ,I create a class implements UncaughtExceptionHandler , and set it as a default handler . At most time it work well , but at a special case i can't found log print by this.

In this special case, i see Application class run oncreate again , and pre Activity oncreate , current Activity missed. it seems like a crash happened, but in my CrashHandler did't caught it. is there some crash can avoid this?

@Override
    public void uncaughtException(Thread thread, Throwable ex) {
        // in special case, we can't found log printed here.
        LogUtil.e(TAG, "uncaughtException" + ex.getMessage());
        // handleException(ex) is we used to print log.
        if (!handleException(ex) && mDefaultHandler != null) {
            LogUtil.e(TAG, "uncaughtException user don't handle");
            mDefaultHandler.uncaughtException(thread, ex);
        }
    }
leon chen
  • 11
  • 4
  • Just a suggestion... try something like Crashlytics instead... probably going to be more reliable than rolling your own solution – Kushan Sep 09 '19 at 09:02
  • @Kushan I have use a Crash collect platform like Crashlytics , but it didn't report this error. – leon chen Sep 23 '19 at 06:49

0 Answers0