Relaunch Android app when it crashes
// momentum
// why it's here
- Active: last commit today
- Around since 2017 and still shipping
// how to help
// readme
Frankenstein
Relaunch your Android app when it crashes
Dependency
Add mavenCentral() to your dependency repositories, then use the latest published version:
dependencies {
implementation("com.commit451:frankenstein:1.2.1")
}
Usage
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
//if you have a DEFAULT activity defined
Frankenstein.register(this);
}
}
If you do not have a default activity defined:
//specific the intent you want to relaunch when the app crashes
Frankenstein.register(this, new Intent(this, LaunchActivity.class));
Make sure to call this after setting up any crash reporting software such as Fabric. Now later, if your app crashes, your LaunchActivity will be launched
Android Studio clears LogCat when the app is restarted, so, you might want to surround the registration with a non-debug check:
if (!BuildConfig.DEBUG) {
Frankenstein.register(this);
}