android-coroutines / nl.adaptivity.android.coroutines / withActivityResult

withActivityResult

fun <A : Activity> A.withActivityResult(intent: Intent, body: A.(ActivityResult) -> Unit): Unit

Extension method for activity that invokes Activity.startActivityForResult and invokes the callback in body when complete. For use in Kotlin consider activityResult as a suspending function instead.

Parameters

intent - The intent to invoke.

body - The callback invoked on completion.

Receiver
The activity that is extended.

fun <A : Activity> A.withActivityResult(intent: Intent, options: Bundle?, body: SerializableHandler<A, ActivityResult>): Unit

Extension method for activity that invokes Activity.startActivityForResult and invokes the callback in body when complete. For use in Kotlin consider activityResult as a suspending function instead.

Parameters

intent - The intent to invoke.

options - The options to pass on the activity start.

body - The callback invoked on completion.

Receiver
The activity that is extended.