actionStartService

Function

Android
fun actionStartService(intent: Intent, isForegroundService: Boolean = false): Action

Creates an Action that launches a Service from the given Intent when triggered. The intent should specify a component with Intent.setClass or Intent.setComponent.

Parameters

intentthe intent used to launch the activity
isForegroundServiceset to true when the provided Service runs in foreground. This flag is only used for device versions after android.os.Build.VERSION_CODES.O that requires foreground service to be launched differently
Android
fun actionStartService(componentName: ComponentName, isForegroundService: Boolean = false): Action

Creates an Action that launches the Service specified by the given ComponentName.

Parameters

componentNamecomponent of the Service to launch
isForegroundServiceset to true when the provided Service runs in foreground. This flag is only used for device versions after android.os.Build.VERSION_CODES.O that requires foreground service to be launched differently
Android
fun <T : Service> actionStartService(
    service: Class<T>,
    isForegroundService: Boolean = false
): Action

Creates an Action that launches the specified Service when triggered.

Parameters

serviceclass of the Service to launch
isForegroundServiceset to true when the provided Service runs in foreground. This flag is only used for device versions after android.os.Build.VERSION_CODES.O that requires foreground service to be launched differently
Android
inline fun <reified T : Service> actionStartService(isForegroundService: Boolean = false): Action

Creates an Action that launches the specified Service when triggered.

Parameters

isForegroundServiceset to true when the provided Service runs in foreground. This flag is only used for device versions after android.os.Build.VERSION_CODES.O that requires foreground service to be launched differently.