ActivityResultContracts.RequestPermission


class ActivityResultContracts.RequestPermission : ActivityResultContract


An ActivityResultContract to request a permission

Summary

Public constructors

Public functions

open Intent
createIntent(context: Context, input: String)

Create an intent that can be used for android.app.Activity.startActivityForResult.

open ActivityResultContract.SynchronousResult<Boolean>?
getSynchronousResult(context: Context, input: String)

An optional method you can implement that can be used to potentially provide a result in lieu of starting an activity.

open Boolean
parseResult(resultCode: Int, intent: Intent?)

Convert result obtained from android.app.Activity.onActivityResult to O.

Public constructors

RequestPermission

Added in 1.2.0
RequestPermission()

Public functions

createIntent

Added in 1.2.0
open fun createIntent(context: Context, input: String): Intent

Create an intent that can be used for android.app.Activity.startActivityForResult.

getSynchronousResult

Added in 1.2.0
open fun getSynchronousResult(context: Context, input: String): ActivityResultContract.SynchronousResult<Boolean>?

An optional method you can implement that can be used to potentially provide a result in lieu of starting an activity.

Returns
ActivityResultContract.SynchronousResult<Boolean>?

the result wrapped in a SynchronousResult or null if the call should proceed to start an activity.

parseResult

Added in 1.10.0-rc01
open fun parseResult(resultCode: Int, intent: Intent?): Boolean

Convert result obtained from android.app.Activity.onActivityResult to O.