explaingit

ereza/customactivityoncrash

3,759JavaAudience · developerComplexity · 2/5Setup · easy

TLDR

CustomActivityOnCrash is an Android library that replaces the generic system crash popup with a custom screen you control, showing a friendly message, restart button, and optional error details.

Mindmap

mindmap
  root((customactivityoncrash))
    What it does
      Replace crash dialog
      Show custom screen
      Handle app recovery
    Features
      Restart button
      Error detail view
      Activity history log
    Configuration
      Builder API
      Crash interval limit
      Custom illustration
    Integrations
      Firebase Crashlytics
      ACRA reporting
      Analytics callbacks
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Replace the default Android crash popup with a branded screen that shows users a restart button instead of a generic error message.

USE CASE 2

Log crash events in Firebase Crashlytics or your own analytics by plugging into the crash callback listener.

USE CASE 3

Show the user which screens they visited before the crash by enabling the optional activity history tracking mode.

USE CASE 4

Configure the library to disable the crash screen in development builds while keeping it active in production.

Tech stack

JavaAndroid

Getting it running

Difficulty · easy Time to first run · 5min

Requires a specific initialization order when used alongside Firebase Crashlytics or ACRA, read the README notes before configuring both.

License terms are not specified in the explanation.

In plain English

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.

Copy-paste prompts

Prompt 1
I added CustomActivityOnCrash to my Android app. How do I configure it to restart at a specific activity instead of the default launch screen?
Prompt 2
How do I integrate CustomActivityOnCrash with Firebase Crashlytics so crashes are reported to Crashlytics before my custom screen is shown?
Prompt 3
Show me how to enable activity history tracking in CustomActivityOnCrash and display the last visited screens on the error details view.
Prompt 4
Using CustomActivityOnCrash's builder, how do I swap the default bug illustration for my own custom drawable?
Open on GitHub → Explain another repo

← ereza on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.