showEnableServiceActivity

fun showEnableServiceActivity(context: Context, identifier: String, settingsIntent: Intent): CompletableDeferred<Boolean>

Shows an EnableServiceActivity that launches a given Intent and waits for it to return.

Return

A CompletableDeferred that completes when settingsIntent has completed. true indicates that the service was successfully enabled.

Parameters

context

The Context in which to launch the EnableServiceActivity

identifier

Unique identifier used to ensure the Intent returns to the right result.

settingsIntent

An Intent that requests the user to enable a service. Should work with ActivityResultContracts.StartActivityForResult to get a proper result.