ActivityResultContracts.RequestPermission

public final class ActivityResultContracts.RequestPermission extends ActivityResultContract


An ActivityResultContract to request a permission

Summary

Public methods

@NonNull @Override Intent

Create an intent that can be used for startActivityForResult

@Override @Nullable 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.

@NonNull @Override Boolean
parseResult(@NonNull int resultCode, @Nullable Intent intent)

Convert result obtained from onActivityResult to O

Public methods

createIntent

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

Create an intent that can be used for startActivityForResult

getSynchronousResult

@Override
@Nullable
@NonNull
public @Override ActivityResultContract.SynchronousResult<@NonNull BooleangetSynchronousResult(@NonNull Context context, @Nullable 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 Boolean>

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

parseResult

@NonNull
@Override
public @Override Boolean parseResult(@NonNull int resultCode, @Nullable Intent intent)

Convert result obtained from onActivityResult to O