Skip to content

Instantly share code, notes, and snippets.

@NikolaDespotoski
Created March 31, 2020 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NikolaDespotoski/906f25a6e2fb858f39bd69b1660a95b5 to your computer and use it in GitHub Desktop.
Save NikolaDespotoski/906f25a6e2fb858f39bd69b1660a95b5 to your computer and use it in GitHub Desktop.
fun <I, O> prepareCall(activityResultContractor: ActivityResultContractor<I, O>,activityResultCallback: ActivityResultCallback<O>)
: ActivityResultLauncher<I> = prepareCall(object : ActivityResultContract<I, O>() {
override fun createIntent(input: I): Intent = activityResultContractor.createIntent(input)
override fun parseResult(resultCode: Int, intent: Intent?): O = activityResultContractor.parseResult(resultCode, intent)
}, activityResultCallback)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment