# ActivityCompat.PermissionCompatDelegate

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1  

# ActivityCompat.PermissionCompatDelegate

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public
static


interface
ActivityCompat.PermissionCompatDelegate
`  
`


`

|----------------------------------------------------------------|
| android.support.v4.app.ActivityCompat.PermissionCompatDelegate |

<br />

*** ** * ** ***

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.

<br />

## Summary

|                                                                                                                                                                                                                                                                                                               ### Public methods                                                                                                                                                                                                                                                                                                               ||
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract boolean` | ` `[onActivityResult](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.PermissionCompatDelegate#onActivityResult(android.app.Activity, int, int, android.content.Intent))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, int requestCode, int resultCode, `[Intent](https://developer.android.com/reference/android/content/Intent.html)` data) ` Determines whether the delegate should handle the permission request as part of`FragmentActivity#onActivityResult(int, int, Intent)`.                                                          |
| ` abstract boolean` | ` `[requestPermissions](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.PermissionCompatDelegate#requestPermissions(android.app.Activity, java.lang.String[], int))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, String[] permissions, int requestCode) ` Determines whether the delegate should handle[requestPermissions(Activity, String[], int)](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#requestPermissions(android.app.Activity, java.lang.String[], int)), and request permissions if applicable. |

## Public methods

### onActivityResult

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
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.

<br />

|                                                                         Parameters                                                                          ||
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `activity`    | `Activity`: The target Activity. <br />                                                                                                      |
| `requestCode` | `int`: The integer request code originally supplied to`startActivityForResult()`, allowing you to identify who this result came from. <br /> |
| `resultCode`  | `int`: The integer result code returned by the child activity through itssetResult()}. <br />                                                |
| `data`        | `Intent`: An Intent, which can return result data to the caller (various data can be attached to Intent "extras"). <br />                    |

|                                 Returns                                 ||
|-----------|--------------------------------------------------------------|
| `boolean` | Whether the delegate has handled the activity result. <br /> |

**See also:**

- [requestPermissions(Activity, String[], int)](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#requestPermissions(android.app.Activity, java.lang.String[], int))  

### requestPermissions

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean requestPermissions (Activity activity, 
                String[] permissions, 
                int requestCode)
```

Determines whether the delegate should handle[requestPermissions(Activity, String[], int)](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#requestPermissions(android.app.Activity, java.lang.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.

<br />

|                                                                                                                                                                     Parameters                                                                                                                                                                     ||
|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `activity`    | `Activity`: The target activity. <br />                                                                                                                                                                                                                                                                                             |
| `permissions` | `String`: The requested permissions. Must me non-null and not empty. <br />                                                                                                                                                                                                                                                         |
| `requestCode` | `int`: Application specific request code to match with a result reported to[onRequestPermissionsResult(int, String[], int[])](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback#onRequestPermissionsResult(int, java.lang.String[], int[])). Should be \>= 0. <br /> |

|                                  Returns                                   ||
|-----------|-----------------------------------------------------------------|
| `boolean` | Whether the delegate has handled the permission request. <br /> |

**See also:**

- [requestPermissions(Activity, String[], int)](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#requestPermissions(android.app.Activity, java.lang.String[], int))  
-

  ## Annotations

  - [NotificationCompat.Action.SemanticAction](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action.SemanticAction)
-

  ## Interfaces

  - [ActionBarDrawerToggle.Delegate](https://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.Delegate)
  - [ActionBarDrawerToggle.DelegateProvider](https://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.DelegateProvider)
  - [ActivityCompat.OnRequestPermissionsResultCallback](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback)
  - [ActivityCompat.PermissionCompatDelegate](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.PermissionCompatDelegate)
  - [FragmentManager.BackStackEntry](https://developer.android.com/reference/android/support/v4/app/FragmentManager.BackStackEntry)
  - [FragmentManager.OnBackStackChangedListener](https://developer.android.com/reference/android/support/v4/app/FragmentManager.OnBackStackChangedListener)
  - [LoaderManager.LoaderCallbacks](https://developer.android.com/reference/android/support/v4/app/LoaderManager.LoaderCallbacks)
  - [NotificationCompat.Action.Extender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action.Extender)
  - [NotificationCompat.Extender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Extender)
  - [SharedElementCallback.OnSharedElementsReadyListener](https://developer.android.com/reference/android/support/v4/app/SharedElementCallback.OnSharedElementsReadyListener)
  - [TaskStackBuilder.SupportParentable](https://developer.android.com/reference/android/support/v4/app/TaskStackBuilder.SupportParentable)
-

  ## Classes

  - [ActionBarDrawerToggle](https://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle)
  - [ActivityCompat](https://developer.android.com/reference/android/support/v4/app/ActivityCompat)
  - [ActivityManagerCompat](https://developer.android.com/reference/android/support/v4/app/ActivityManagerCompat)
  - [ActivityOptionsCompat](https://developer.android.com/reference/android/support/v4/app/ActivityOptionsCompat)
  - [AlarmManagerCompat](https://developer.android.com/reference/android/support/v4/app/AlarmManagerCompat)
  - [AppLaunchChecker](https://developer.android.com/reference/android/support/v4/app/AppLaunchChecker)
  - [AppOpsManagerCompat](https://developer.android.com/reference/android/support/v4/app/AppOpsManagerCompat)
  - [BundleCompat](https://developer.android.com/reference/android/support/v4/app/BundleCompat)
  - [DialogFragment](https://developer.android.com/reference/android/support/v4/app/DialogFragment)
  - [Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment)
  - [Fragment.SavedState](https://developer.android.com/reference/android/support/v4/app/Fragment.SavedState)
  - [FragmentActivity](https://developer.android.com/reference/android/support/v4/app/FragmentActivity)
  - [FragmentContainer](https://developer.android.com/reference/android/support/v4/app/FragmentContainer)
  - [FragmentController](https://developer.android.com/reference/android/support/v4/app/FragmentController)
  - [FragmentHostCallback](https://developer.android.com/reference/android/support/v4/app/FragmentHostCallback)
  - [FragmentManager](https://developer.android.com/reference/android/support/v4/app/FragmentManager)
  - [FragmentManager.FragmentLifecycleCallbacks](https://developer.android.com/reference/android/support/v4/app/FragmentManager.FragmentLifecycleCallbacks)
  - [FragmentManagerNonConfig](https://developer.android.com/reference/android/support/v4/app/FragmentManagerNonConfig)
  - [FragmentPagerAdapter](https://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter)
  - [FragmentStatePagerAdapter](https://developer.android.com/reference/android/support/v4/app/FragmentStatePagerAdapter)
  - [FragmentTabHost](https://developer.android.com/reference/android/support/v4/app/FragmentTabHost)
  - [FragmentTransaction](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction)
  - [FrameMetricsAggregator](https://developer.android.com/reference/android/support/v4/app/FrameMetricsAggregator)
  - [JobIntentService](https://developer.android.com/reference/android/support/v4/app/JobIntentService)
  - [ListFragment](https://developer.android.com/reference/android/support/v4/app/ListFragment)
  - [LoaderManager](https://developer.android.com/reference/android/support/v4/app/LoaderManager)
  - [NavUtils](https://developer.android.com/reference/android/support/v4/app/NavUtils)
  - [NotificationCompat](https://developer.android.com/reference/android/support/v4/app/NotificationCompat)
  - [NotificationCompat.Action](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action)
  - [NotificationCompat.Action.Builder](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action.Builder)
  - [NotificationCompat.Action.WearableExtender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action.WearableExtender)
  - [NotificationCompat.BigPictureStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.BigPictureStyle)
  - [NotificationCompat.BigTextStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.BigTextStyle)
  - [NotificationCompat.Builder](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder)
  - [NotificationCompat.CarExtender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender)
  - [NotificationCompat.CarExtender.UnreadConversation](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender.UnreadConversation)
  - [NotificationCompat.CarExtender.UnreadConversation.Builder](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender.UnreadConversation.Builder)
  - [NotificationCompat.DecoratedCustomViewStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.DecoratedCustomViewStyle)
  - [NotificationCompat.InboxStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.InboxStyle)
  - [NotificationCompat.MessagingStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.MessagingStyle)
  - [NotificationCompat.MessagingStyle.Message](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.MessagingStyle.Message)
  - [NotificationCompat.Style](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Style)
  - [NotificationCompat.WearableExtender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.WearableExtender)
  - [NotificationCompatExtras](https://developer.android.com/reference/android/support/v4/app/NotificationCompatExtras)
  - [NotificationCompatSideChannelService](https://developer.android.com/reference/android/support/v4/app/NotificationCompatSideChannelService)
  - [NotificationManagerCompat](https://developer.android.com/reference/android/support/v4/app/NotificationManagerCompat)
  - [RemoteInput](https://developer.android.com/reference/android/support/v4/app/RemoteInput)
  - [RemoteInput.Builder](https://developer.android.com/reference/android/support/v4/app/RemoteInput.Builder)
  - [ServiceCompat](https://developer.android.com/reference/android/support/v4/app/ServiceCompat)
  - [ShareCompat](https://developer.android.com/reference/android/support/v4/app/ShareCompat)
  - [ShareCompat.IntentBuilder](https://developer.android.com/reference/android/support/v4/app/ShareCompat.IntentBuilder)
  - [ShareCompat.IntentReader](https://developer.android.com/reference/android/support/v4/app/ShareCompat.IntentReader)
  - [SharedElementCallback](https://developer.android.com/reference/android/support/v4/app/SharedElementCallback)
  - [TaskStackBuilder](https://developer.android.com/reference/android/support/v4/app/TaskStackBuilder)
-

  ## Exceptions

  - [Fragment.InstantiationException](https://developer.android.com/reference/android/support/v4/app/Fragment.InstantiationException)