ActivityResultContracts.RequestMultiplePermissions


class ActivityResultContracts.RequestMultiplePermissions : ActivityResultContract


An ActivityResultContract to request permissions

Summary

Constants

const String

An Intent action for making a permission request via a regular Activity.startActivityForResult API.

const String

Key for the extra containing all the requested permissions.

const String

Key for the extra containing whether permissions were granted.

Public constructors

Public functions

open Intent
createIntent(context: Context, input: Array<String>)

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

open ActivityResultContract.SynchronousResult<Map<StringBoolean>>?

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

open Map<StringBoolean>
parseResult(resultCode: Int, intent: Intent?)

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

Constants

ACTION_REQUEST_PERMISSIONS

const val ACTION_REQUEST_PERMISSIONSString

An Intent action for making a permission request via a regular Activity.startActivityForResult API.

Caller must provide a String[] extra EXTRA_PERMISSIONS

Result will be delivered via Activity.onActivityResult with String[] EXTRA_PERMISSIONS and int[] EXTRA_PERMISSION_GRANT_RESULTS, similar to Activity.onRequestPermissionsResult

EXTRA_PERMISSIONS

const val EXTRA_PERMISSIONSString

Key for the extra containing all the requested permissions.

EXTRA_PERMISSION_GRANT_RESULTS

const val EXTRA_PERMISSION_GRANT_RESULTSString

Key for the extra containing whether permissions were granted.

Public constructors

RequestMultiplePermissions

Added in 1.2.0
RequestMultiplePermissions()

Public functions

createIntent

Added in 1.2.0
open fun createIntent(context: Context, input: Array<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: Array<String>): ActivityResultContract.SynchronousResult<Map<StringBoolean>>?

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

Returns
ActivityResultContract.SynchronousResult<Map<StringBoolean>>?

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

parseResult

open fun parseResult(resultCode: Int, intent: Intent?): Map<StringBoolean>

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