ActivityResultContracts.RequestPermission


public final class ActivityResultContracts.RequestPermission extends ActivityResultContract


An ActivityResultContract to request a permission

Summary

Public constructors

Public methods

@NonNull Intent

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

ActivityResultContract.SynchronousResult<@NonNull Boolean>

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

boolean
parseResult(int resultCode, Intent intent)

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

Public constructors

RequestPermission

Added in 1.2.0
public RequestPermission()

Public methods

createIntent

Added in 1.2.0
public @NonNull Intent createIntent(@NonNull Context context, @NonNull String input)

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

getSynchronousResult

Added in 1.2.0
public ActivityResultContract.SynchronousResult<@NonNull BooleangetSynchronousResult(@NonNull Context context, @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
ActivityResultContract.SynchronousResult<@NonNull 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
public boolean parseResult(int resultCode, Intent intent)

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