O Google tem o compromisso de promover a igualdade racial para as comunidades negras. Saiba como.

ActivityResultContracts.RequestMultiplePermissions

public static final class ActivityResultContracts.RequestMultiplePermissions
extends ActivityResultContract<String[], Map<String, Boolean>>

java.lang.Object
   ↳ androidx.activity.result.contract.ActivityResultContract<java.lang.String[], java.util.Map<java.lang.String, java.lang.Boolean>>
     ↳ androidx.activity.result.contract.ActivityResultContracts.RequestMultiplePermissions


An ActivityResultContract to request permissions

Summary

Constants

String ACTION_REQUEST_PERMISSIONS

An Intent action for making a permission request via a regular Activity.startActivityForResult(Intent, int) API.

String EXTRA_PERMISSIONS

Key for the extra containing all the requested permissions.

String EXTRA_PERMISSION_GRANT_RESULTS

Key for the extra containing whether permissions were granted.

Public constructors

RequestMultiplePermissions()

Public methods

Intent createIntent(Context context, String[] input)

Create an intent that can be used for Activity.startActivityForResult(Intent, int)

SynchronousResult<Map<String, Boolean>> getSynchronousResult(Context context, String[] input)

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

Map<String, Boolean> parseResult(int resultCode, Intent intent)

Convert result obtained from Activity.onActivityResult(int, int, Intent) to O

Inherited methods

Constants

ACTION_REQUEST_PERMISSIONS

public static final String ACTION_REQUEST_PERMISSIONS

An Intent action for making a permission request via a regular Activity.startActivityForResult(Intent, int) API. Caller must provide a String[] extra EXTRA_PERMISSIONS Result will be delivered via Activity.onActivityResult(int, int, Intent) with String[] EXTRA_PERMISSIONS and int[] EXTRA_PERMISSION_GRANT_RESULTS, similar to Activity.onRequestPermissionsResult(int, String[], int[])

Constant Value: "androidx.activity.result.contract.action.REQUEST_PERMISSIONS"

EXTRA_PERMISSIONS

public static final String EXTRA_PERMISSIONS

Key for the extra containing all the requested permissions.

Constant Value: "androidx.activity.result.contract.extra.PERMISSIONS"

EXTRA_PERMISSION_GRANT_RESULTS

public static final String EXTRA_PERMISSION_GRANT_RESULTS

Key for the extra containing whether permissions were granted.

Constant Value: "androidx.activity.result.contract.extra.PERMISSION_GRANT_RESULTS"

Public constructors

RequestMultiplePermissions

public RequestMultiplePermissions ()

Public methods

createIntent

public Intent createIntent (Context context, 
                String[] input)

Create an intent that can be used for Activity.startActivityForResult(Intent, int)

Parameters
context Context

input String

Returns
Intent

getSynchronousResult

public SynchronousResult<Map<String, Boolean>> getSynchronousResult (Context context, 
                String[] input)

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

Parameters
context Context

input String

Returns
SynchronousResult<Map<String, Boolean>> the result wrapped in a ActivityResultContract.SynchronousResult or null if the call should proceed to start an activity.

parseResult

public Map<String, Boolean> parseResult (int resultCode, 
                Intent intent)

Convert result obtained from Activity.onActivityResult(int, int, Intent) to O

Parameters
resultCode int

intent Intent

Returns
Map<String, Boolean>