ProcessRestarter

ProcessRestarter facilitates restarting your application process. This should only be used for things like fundamental state changes in your debug builds (e.g., changing from staging to production).

Trigger process recreation by calling triggerRebirth with a Context instance.

Functions

Link copied to clipboard

Checks if the current process is a temporary Process. This can be used to avoid initialization of unused resources or to prevent running code that is not multi-process ready.

Link copied to clipboard
fun triggerRebirth(context: Context)

Call to restart the application process using the default activity as an intent.

fun triggerRebirth(context: Context, targetClass: Class<out Activity>)

Call to restart the application process using the provided Activity Class.

fun triggerRebirth(context: Context, vararg nextIntents: Intent)

Call to restart the application process using the specified intents.

Link copied to clipboard
fun triggerServiceRebirth(context: Context, nextIntent: Intent)

Call to restart the application process using the specified Service intent.

fun triggerServiceRebirth(context: Context, targetClass: Class<out Service>)

Call to restart the application process using the provided Service Class.