public final class CustomActivityOnCrash
extends java.lang.Object
| Constructor and Description |
|---|
CustomActivityOnCrash() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeApplication(android.app.Activity activity)
Closes the app.
|
static java.lang.String |
getAllErrorDetailsFromIntent(android.content.Context context,
android.content.Intent intent)
Given an Intent, returns several error details including the stack trace extra from the intent.
|
static int |
getDefaultErrorActivityDrawable()
Returns the default error activity drawable identifier.
|
static int |
getDefaultErrorActivityDrawableIdFromIntent(android.content.Intent intent)
Given an Intent, returns the drawable id of the image to show on the default error activity.
|
static java.lang.Class<? extends android.app.Activity> |
getErrorActivityClass()
Returns the error activity class to launch when a crash occurs.
|
static java.lang.Class<? extends android.app.Activity> |
getRestartActivityClass()
Returns the main activity class that the error activity must launch when a crash occurs.
|
static java.lang.Class<? extends android.app.Activity> |
getRestartActivityClassFromIntent(android.content.Intent intent)
Given an Intent, returns the restart activity class extra from it.
|
static java.lang.String |
getStackTraceFromIntent(android.content.Intent intent)
Given an Intent, returns the stack trace extra from it.
|
static void |
install(android.content.Context context)
Installs CustomActivityOnCrash on the application using the default error activity.
|
static boolean |
isEnableAppRestart()
Returns if the error activity should show a restart button.
|
static boolean |
isLaunchErrorActivityWhenInBackground()
Returns if the error activity must be launched when the app is on background.
|
static boolean |
isShowErrorDetails()
Returns if the error activity will show the error details button.
|
static boolean |
isShowErrorDetailsFromIntent(android.content.Intent intent)
Given an Intent, returns if the error details button should be displayed.
|
static void |
restartApplicationWithIntent(android.app.Activity activity,
android.content.Intent intent)
Given an Intent, restarts the app and launches a startActivity to that intent.
|
static void |
setDefaultErrorActivityDrawable(int defaultErrorActivityDrawableId)
Defines which drawable to use in the default error activity image.
|
static void |
setEnableAppRestart(boolean enableAppRestart)
Defines if the error activity should show a restart button.
|
static void |
setErrorActivityClass(java.lang.Class<? extends android.app.Activity> errorActivityClass)
Sets the error activity class to launch when a crash occurs.
|
static void |
setLaunchErrorActivityWhenInBackground(boolean launchErrorActivityWhenInBackground)
Defines if the error activity must be launched when the app is on background.
|
static void |
setRestartActivityClass(java.lang.Class<? extends android.app.Activity> restartActivityClass)
Sets the main activity class that the error activity must launch when a crash occurs.
|
static void |
setShowErrorDetails(boolean showErrorDetails)
Defines if the error activity must shown the error details button.
|
public static void install(android.content.Context context)
context - Context to use for obtaining the ApplicationContext. Must not be null.public static boolean isShowErrorDetailsFromIntent(android.content.Intent intent)
intent - The Intent. Must not be null.public static int getDefaultErrorActivityDrawableIdFromIntent(android.content.Intent intent)
intent - The Intent. Must not be null.public static java.lang.String getStackTraceFromIntent(android.content.Intent intent)
intent - The Intent. Must not be null.public static java.lang.String getAllErrorDetailsFromIntent(android.content.Context context,
android.content.Intent intent)
context - A valid context. Must not be null.intent - The Intent. Must not be null.public static java.lang.Class<? extends android.app.Activity> getRestartActivityClassFromIntent(android.content.Intent intent)
intent - The Intent. Must not be null.public static void restartApplicationWithIntent(android.app.Activity activity,
android.content.Intent intent)
activity - The current error activity. Must not be null.intent - The Intent. Must not be null.public static void closeApplication(android.app.Activity activity)
activity - The current error activity. Must not be null.public static boolean isLaunchErrorActivityWhenInBackground()
public static void setLaunchErrorActivityWhenInBackground(boolean launchErrorActivityWhenInBackground)
public static boolean isShowErrorDetails()
public static void setShowErrorDetails(boolean showErrorDetails)
public static int getDefaultErrorActivityDrawable()
public static void setDefaultErrorActivityDrawable(int defaultErrorActivityDrawableId)
public static boolean isEnableAppRestart()
public static void setEnableAppRestart(boolean enableAppRestart)
public static java.lang.Class<? extends android.app.Activity> getErrorActivityClass()
public static void setErrorActivityClass(java.lang.Class<? extends android.app.Activity> errorActivityClass)
public static java.lang.Class<? extends android.app.Activity> getRestartActivityClass()
public static void setRestartActivityClass(java.lang.Class<? extends android.app.Activity> restartActivityClass)