public interface

ActivityCompat.PermissionCompatDelegate

 androidx.core.app.ActivityCompat.PermissionCompatDelegate

Overview

Customizable delegate that allows delegating permission compatibility methods to a custom implementation.

To delegate permission compatibility methods to a custom class, implement this interface, and call ActivityCompat.setPermissionCompatDelegate(delegate);. All future calls to the permission compatibility methods in this class will first check whether the delegate can handle the method call, and invoke the corresponding method if it can.

Summary

Methods
public booleanonActivityResult(Activity activity, int requestCode, int resultCode, Intent data)

Determines whether the delegate should handle the permission request as part of FragmentActivity#onActivityResult(int, int, Intent).

public booleanrequestPermissions(Activity activity, java.lang.String permissions[], int requestCode)

Determines whether the delegate should handle ActivityCompat.requestPermissions(Activity, String[], int), and request permissions if applicable.

Methods

public boolean requestPermissions(Activity activity, java.lang.String permissions[], int requestCode)

Determines whether the delegate should handle ActivityCompat.requestPermissions(Activity, String[], int), and request permissions if applicable. If this method returns true, it means that permission request is successfully handled by the delegate, and platform should not perform any further requests for permission.

Parameters:

activity: The target activity.
permissions: The requested permissions. Must be non-null and not empty.
requestCode: Application specific request code to match with a result reported to ActivityCompat.OnRequestPermissionsResultCallback.onRequestPermissionsResult(int, String[], int[]). Should be >= 0.

Returns:

Whether the delegate has handled the permission request.

See also: ActivityCompat.requestPermissions(Activity, String[], int)

public boolean onActivityResult(Activity activity, int requestCode, int resultCode, Intent data)

Determines whether the delegate should handle the permission request as part of FragmentActivity#onActivityResult(int, int, Intent). If this method returns true, it means that activity result is successfully handled by the delegate, and no further action is needed on this activity result.

Parameters:

activity: The target Activity.
requestCode: The integer request code originally supplied to startActivityForResult(), allowing you to identify who this result came from.
resultCode: The integer result code returned by the child activity through its setResult()}.
data: An Intent, which can return result data to the caller (various data can be attached to Intent "extras").

Returns:

Whether the delegate has handled the activity result.

See also: ActivityCompat.requestPermissions(Activity, String[], int)