ActivityResultContracts.RequestMultiplePermissions

public final class ActivityResultContracts.RequestMultiplePermissions extends ActivityResultContract


An ActivityResultContract to request permissions

Summary

Constants

static final @NonNull String

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

static final @NonNull String

Key for the extra containing all the requested permissions.

static final @NonNull String

Key for the extra containing whether permissions were granted.

Public methods

@NonNull @Override Intent

Create an intent that can be used for startActivityForResult

@Override @Nullable ActivityResultContract.SynchronousResult<@NonNull Map<@NonNull String, @NonNull Boolean>>
getSynchronousResult(
    @NonNull Context context,
    @Nullable Array<@NonNull String> input
)

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

@NonNull @Override Map<@NonNull String, @NonNull Boolean>
parseResult(@NonNull int resultCode, @Nullable Intent intent)

Convert result obtained from onActivityResult to O

Constants

ACTION_REQUEST_PERMISSIONS

@NonNull
public static final @NonNull String ACTION_REQUEST_PERMISSIONS

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

See also
requestPermissions

Activity#requestPermissions(String[], int)

onRequestPermissionsResult

Activity#onRequestPermissionsResult(int, String[], int[])

EXTRA_PERMISSIONS

@NonNull
public static final @NonNull String EXTRA_PERMISSIONS

Key for the extra containing all the requested permissions.

See also
ACTION_REQUEST_PERMISSIONS

#ACTION_REQUEST_PERMISSIONS

EXTRA_PERMISSION_GRANT_RESULTS

@NonNull
public static final @NonNull String EXTRA_PERMISSION_GRANT_RESULTS

Key for the extra containing whether permissions were granted.

See also
ACTION_REQUEST_PERMISSIONS

#ACTION_REQUEST_PERMISSIONS

Public methods

createIntent

@NonNull
@Override
public @Override Intent createIntent(@NonNull Context context, @NonNull Array<@NonNull String> input)

Create an intent that can be used for startActivityForResult

getSynchronousResult

@Override
@Nullable
@NonNull
public @Override ActivityResultContract.SynchronousResult<@NonNull Map<@NonNull String, @NonNull Boolean>> getSynchronousResult(
    @NonNull Context context,
    @Nullable Array<@NonNull String> input
)

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

Returns
@Override ActivityResultContract.SynchronousResult<@NonNull Map<@NonNull String, @NonNull Boolean>>

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

parseResult

@NonNull
@Override
public @Override Map<@NonNull String, @NonNull BooleanparseResult(@NonNull int resultCode, @Nullable Intent intent)

Convert result obtained from onActivityResult to O