Replace the default Android crash popup with a branded screen that shows users a restart button instead of a generic error message.
Log crash events in Firebase Crashlytics or your own analytics by plugging into the crash callback listener.
Show the user which screens they visited before the crash by enabling the optional activity history tracking mode.
Configure the library to disable the crash screen in development builds while keeping it active in production.
Requires a specific initialization order when used alongside Firebase Crashlytics or ACRA, read the README notes before configuring both.
CustomActivityOnCrash is an Android library that replaces the default system crash dialog with a screen your app controls. When Android apps crash, the operating system shows a generic popup that says something like "Unfortunately, X has stopped" with no useful information and no recovery option. This library intercepts that moment and shows your own screen instead. Adding the library to an Android project takes a single line in the build configuration file. After that, it works automatically with no extra code required. The default crash screen it provides shows a description of what went wrong, a button to restart the app, and a button to view technical error details. All of those elements can be turned on or off depending on what you want your users to see. The library has a configuration builder that controls its behavior in detail. You can choose whether to show the crash screen at all (useful for switching it off in development builds), set a minimum time between crashes to avoid looping crash screens, swap out the default bug illustration for your own image, and point the restart button at a specific screen in your app rather than the default launch point. You can also plug in a listener that fires callbacks when the crash screen appears, the app restarts, or the app closes, which lets you log events in your own analytics system. It works alongside crash reporting tools like Firebase Crashlytics and ACRA. The README notes specific setup steps required when those tools are also present, mainly around the order in which they are initialized. The library also has an optional activity tracking mode that records which screens the user visited before the crash, adding that history to the error details view. The project is a passive dependency for Android developers who want a better user experience during unexpected failures. It does not prevent crashes, it only controls what the user sees and what options they have after a crash occurs.
← ereza on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.