Log.e(TAG,"IMPORTANT WARNING! You already have an UncaughtExceptionHandler, are you sure this is correct? If you use a custom UncaughtExceptionHandler, you must initialize it AFTER CustomActivityOnCrash! Installing anyway, but your original handler will not be called.");
Log.e(TAG,"App has crashed, executing CustomActivityOnCrash's UncaughtExceptionHandler",throwable);
if(hasCrashedInTheLastSeconds(application)){
Log.e(TAG,"App already crashed recently, not starting custom error activity because we could enter a restart loop. Are you sure that your app does not crash directly on init?",throwable);
Log.i(TAG,"CustomActivityOnCrash has been installed.");
}
}catch(Throwablet){
Log.e(TAG,"An unknown error occurred while installing CustomActivityOnCrash, it may not have been properly initialized. Please report this as a bug if needed.",t);
}
}
/**
* Given an Intent, returns the stack trace extra from it.
*
* @param intent The Intent. Must not be null.
* @return The stacktrace, or null if not provided.
thrownewIllegalArgumentException("The event listener cannot be an inner or anonymous class, because it will need to be serialized. Change it to a class of its own, or make it a static inner class.");