# ActivityCompat

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1  
Summary:[Nested Classes](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#nestedclasses)\|[Protected Ctors](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#proctors)\|[Methods](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#)  

# ActivityCompat

| 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


class
ActivityCompat
`  
`


``

extends `[ContextCompat](https://developer.android.com/reference/android/support/v4/content/ContextCompat)`


``


`

|---|---|---------------------------------------|
| java.lang.Object                            |||
| ↳ | [android.support.v4.content.ContextCompat](https://developer.android.com/reference/android/support/v4/content/ContextCompat) ||
|   | ↳ | android.support.v4.app.ActivityCompat |

|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#)Known Direct Subclasses [ActivityCompat](https://developer.android.com/reference/android/support/v13/app/ActivityCompat) |--------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [ActivityCompat](https://developer.android.com/reference/android/support/v13/app/ActivityCompat) | *This class was deprecated in API level 27.1.0. Use[android.support.v4.app.ActivityCompat](https://developer.android.com/reference/android/support/v4/app/ActivityCompat).* | |

<br />

*** ** * ** ***

Helper for accessing features in[Activity](https://developer.android.com/reference/android/app/Activity.html).

## Summary

|                                                                                                                            ### Nested classes                                                                                                                             ||
|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` interface` | [ActivityCompat.OnRequestPermissionsResultCallback](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback) This interface is the contract for receiving the results for permission requests.     |
| ` interface` | [ActivityCompat.PermissionCompatDelegate](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.PermissionCompatDelegate) Customizable delegate that allows delegating permission compatibility methods to a custom implementation. |

|                                                                                                                ### Protected constructors                                                                                                                ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[ActivityCompat](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#ActivityCompat())`() ` This class should not be instantiated, but the constructor must be visible for the class to be extended (as in support-v13). |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ||
|-----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static void`                                                                                                                          | ` `[finishAffinity](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#finishAffinity(android.app.Activity))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity) ` Finish this activity, and tries to finish all activities immediately below it in the current task that have the same affinity.                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` static void`                                                                                                                          | ` `[finishAfterTransition](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#finishAfterTransition(android.app.Activity))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity) ` Reverses the Activity Scene entry Transition and triggers the calling Activity to reverse its exit Transition.                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html)                                                           | ` `[getReferrer](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#getReferrer(android.app.Activity))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity) ` Return information about who launched this activity.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` static boolean`                                                                                                                       | ` `[invalidateOptionsMenu](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#invalidateOptionsMenu(android.app.Activity))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity) ` *This method was deprecated in API level 27.1.0. Use[invalidateOptionsMenu()](https://developer.android.com/reference/android/app/Activity.html#invalidateOptionsMenu())directly.*                                                                                                                                                                                                                                                                                                                                                                                  |
| ` static void`                                                                                                                          | ` `[postponeEnterTransition](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#postponeEnterTransition(android.app.Activity))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` static `[DragAndDropPermissionsCompat](https://developer.android.com/reference/android/support/v13/view/DragAndDropPermissionsCompat) | ` `[requestDragAndDropPermissions](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#requestDragAndDropPermissions(android.app.Activity, android.view.DragEvent))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, `[DragEvent](https://developer.android.com/reference/android/view/DragEvent.html)` dragEvent) ` Create[DragAndDropPermissionsCompat](https://developer.android.com/reference/android/support/v13/view/DragAndDropPermissionsCompat)object bound to this activity and controlling the access permissions for content URIs associated with the[DragEvent](https://developer.android.com/reference/android/view/DragEvent.html).                                                                                                 |
| ` static void`                                                                                                                          | ` `[requestPermissions](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#requestPermissions(android.app.Activity, java.lang.String[], int))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, String[] permissions, int requestCode) ` Requests permissions to be granted to this application.                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` static <T extends `[View](https://developer.android.com/reference/android/view/View.html)`> T`                                        | ` `[requireViewById](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#requireViewById(android.app.Activity, int))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, int id) ` Finds a view that was identified by the`android:id`XML attribute that was processed in[onCreate(Bundle)](https://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle)), or throws an IllegalArgumentException if the ID is invalid, or there is no matching view in the hierarchy.                                                                                                                                                                                                                                                |
| ` static void`                                                                                                                          | ` `[setEnterSharedElementCallback](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#setEnterSharedElementCallback(android.app.Activity, android.support.v4.app.SharedElementCallback))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, `[SharedElementCallback](https://developer.android.com/reference/android/support/v4/app/SharedElementCallback)` callback) ` When[makeSceneTransitionAnimation(Activity, android.view.View, String)](https://developer.android.com/reference/android/app/ActivityOptions.html#makeSceneTransitionAnimation(android.app.Activity, android.view.View, java.lang.String))was used to start an Activity,<var translate="no">callback</var>will be called to handle shared elements on the*launched*Activity. |
| ` static void`                                                                                                                          | ` `[setExitSharedElementCallback](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#setExitSharedElementCallback(android.app.Activity, android.support.v4.app.SharedElementCallback))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, `[SharedElementCallback](https://developer.android.com/reference/android/support/v4/app/SharedElementCallback)` callback) ` When[makeSceneTransitionAnimation(Activity, android.view.View, String)](https://developer.android.com/reference/android/app/ActivityOptions.html#makeSceneTransitionAnimation(android.app.Activity, android.view.View, java.lang.String))was used to start an Activity,<var translate="no">callback</var>will be called to handle shared elements on the*launching*Activity.  |
| ` static void`                                                                                                                          | ` `[setPermissionCompatDelegate](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#setPermissionCompatDelegate(android.support.v4.app.ActivityCompat.PermissionCompatDelegate))`(`[ActivityCompat.PermissionCompatDelegate](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.PermissionCompatDelegate)` delegate) ` Sets the permission delegate for`ActivityCompat`.                                                                                                                                                                                                                                                                                                                                                                                         |
| ` static boolean`                                                                                                                       | ` `[shouldShowRequestPermissionRationale](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#shouldShowRequestPermissionRationale(android.app.Activity, java.lang.String))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, String permission) ` Gets whether you should show UI with rationale for requesting a permission.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` static void`                                                                                                                          | ` `[startActivityForResult](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#startActivityForResult(android.app.Activity, android.content.Intent, int, android.os.Bundle))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, `[Intent](https://developer.android.com/reference/android/content/Intent.html)` intent, int requestCode, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` options) ` Start new activity with options, if able, for which you would like a result when it finished.                                                                                                                                                                                                                        |
| ` static void`                                                                                                                          | ` `[startIntentSenderForResult](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#startIntentSenderForResult(android.app.Activity, android.content.IntentSender, int, android.content.Intent, int, int, int, android.os.Bundle))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, `[IntentSender](https://developer.android.com/reference/android/content/IntentSender.html)` intent, int requestCode, `[Intent](https://developer.android.com/reference/android/content/Intent.html)` fillInIntent, int flagsMask, int flagsValues, int extraFlags, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` options) ` Start new IntentSender with options, if able, for which you would like a result when it finished.     |
| ` static void`                                                                                                                          | ` `[startPostponedEnterTransition](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#startPostponedEnterTransition(android.app.Activity))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#)From class` `[android.support.v4.content.ContextCompat](https://developer.android.com/reference/android/support/v4/content/ContextCompat)` ` |-------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` static int`                                                                                               | ` `[checkSelfPermission](https://developer.android.com/reference/android/support/v4/content/ContextCompat#checkSelfPermission(android.content.Context, java.lang.String))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, String permission) ` Determine whether*you*have been granted a particular permission.                                                                                                                                                                               | | ` static `[Context](https://developer.android.com/reference/android/content/Context.html)                   | ` `[createDeviceProtectedStorageContext](https://developer.android.com/reference/android/support/v4/content/ContextCompat#createDeviceProtectedStorageContext(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) ` Return a new Context object for the current Context but whose storage APIs are backed by device-protected storage.                                                                                                                                  | | ` static File`                                                                                              | ` `[getCodeCacheDir](https://developer.android.com/reference/android/support/v4/content/ContextCompat#getCodeCacheDir(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) ` Returns the absolute path to the application specific cache directory on the filesystem designed for storing cached code.                                                                                                                                                                   | | ` static int`                                                                                               | ` `[getColor](https://developer.android.com/reference/android/support/v4/content/ContextCompat#getColor(android.content.Context, int))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, int id) ` Returns a color associated with a particular resource ID Starting in[M](https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#M), the returned color will be styled for the specified Context's theme.                                                                 | | ` static `[ColorStateList](https://developer.android.com/reference/android/content/res/ColorStateList.html) | ` `[getColorStateList](https://developer.android.com/reference/android/support/v4/content/ContextCompat#getColorStateList(android.content.Context, int))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, int id) ` Returns a color state list associated with a particular resource ID.                                                                                                                                                                                                       | | ` static File`                                                                                              | ` `[getDataDir](https://developer.android.com/reference/android/support/v4/content/ContextCompat#getDataDir(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) ` Returns the absolute path to the directory on the filesystem where all private files belonging to this app are stored.                                                                                                                                                                                | | ` static `[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)       | ` `[getDrawable](https://developer.android.com/reference/android/support/v4/content/ContextCompat#getDrawable(android.content.Context, int))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, int id) ` Returns a drawable object associated with a particular resource ID.                                                                                                                                                                                                                    | | ` static File[]`                                                                                            | ` `[getExternalCacheDirs](https://developer.android.com/reference/android/support/v4/content/ContextCompat#getExternalCacheDirs(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) ` Returns absolute paths to application-specific directories on all external storage devices where the application can place cache files it owns.                                                                                                                                   | | ` static File[]`                                                                                            | ` `[getExternalFilesDirs](https://developer.android.com/reference/android/support/v4/content/ContextCompat#getExternalFilesDirs(android.content.Context, java.lang.String))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, String type) ` Returns absolute paths to application-specific directories on all external storage devices where the application can place persistent files it owns.                                                                                               | | ` static File`                                                                                              | ` `[getNoBackupFilesDir](https://developer.android.com/reference/android/support/v4/content/ContextCompat#getNoBackupFilesDir(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) ` Returns the absolute path to the directory on the filesystem similar to[getFilesDir()](https://developer.android.com/reference/android/content/Context.html#getFilesDir()).                                                                                                         | | ` static File[]`                                                                                            | ` `[getObbDirs](https://developer.android.com/reference/android/support/v4/content/ContextCompat#getObbDirs(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) ` Returns absolute paths to application-specific directories on all external storage devices where the application's OBB files (if there are any) can be found.                                                                                                                                         | | ` static <T> T`                                                                                             | ` `[getSystemService](https://developer.android.com/reference/android/support/v4/content/ContextCompat#getSystemService(android.content.Context, java.lang.Class<T>))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, Class<T> serviceClass) ` Return the handle to a system-level service by class.                                                                                                                                                                                          | | ` static String`                                                                                            | ` `[getSystemServiceName](https://developer.android.com/reference/android/support/v4/content/ContextCompat#getSystemServiceName(android.content.Context, java.lang.Class<?>))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, Class<?> serviceClass) ` Gets the name of the system-level service that is represented by the specified class.                                                                                                                                                  | | ` static boolean`                                                                                           | ` `[isDeviceProtectedStorage](https://developer.android.com/reference/android/support/v4/content/ContextCompat#isDeviceProtectedStorage(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) ` Indicates if the storage APIs of this Context are backed by device-encrypted storage.                                                                                                                                                                                     | | ` static boolean`                                                                                           | ` `[startActivities](https://developer.android.com/reference/android/support/v4/content/ContextCompat#startActivities(android.content.Context, android.content.Intent[], android.os.Bundle))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[Intent[]](https://developer.android.com/reference/android/content/Intent.html)` intents, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` options) ` Start a set of activities as a synthesized task stack, if able. | | ` static boolean`                                                                                           | ` `[startActivities](https://developer.android.com/reference/android/support/v4/content/ContextCompat#startActivities(android.content.Context, android.content.Intent[]))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[Intent[]](https://developer.android.com/reference/android/content/Intent.html)` intents) ` Start a set of activities as a synthesized task stack, if able.                                                                                                        | | ` static void`                                                                                              | ` `[startActivity](https://developer.android.com/reference/android/support/v4/content/ContextCompat#startActivity(android.content.Context, android.content.Intent, android.os.Bundle))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[Intent](https://developer.android.com/reference/android/content/Intent.html)` intent, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` options) ` Start an activity with additional launch information, if able.           | | ` static void`                                                                                              | ` `[startForegroundService](https://developer.android.com/reference/android/support/v4/content/ContextCompat#startForegroundService(android.content.Context, android.content.Intent))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[Intent](https://developer.android.com/reference/android/content/Intent.html)` intent) ` startForegroundService() was introduced in O, just call startService for before O.                                                                            | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Protected constructors

### ActivityCompat

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

```
ActivityCompat ()
```

This class should not be instantiated, but the constructor must be visible for the class to be extended (as in support-v13).

<br />

## Public methods

### finishAffinity

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

```
void finishAffinity (Activity activity)
```

Finish this activity, and tries to finish all activities immediately below it in the current task that have the same affinity.

On Android 4.1+ calling this method will call through to the native version of this method. For other platforms[finish()](https://developer.android.com/reference/android/app/Activity.html#finish())will be called instead.

<br />

<br />

|          Parameters           ||
|------------|-------------------|
| `activity` | `Activity` <br /> |

### finishAfterTransition

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

```
void finishAfterTransition (Activity activity)
```

Reverses the Activity Scene entry Transition and triggers the calling Activity to reverse its exit Transition. When the exit Transition completes,[finish()](https://developer.android.com/reference/android/app/Activity.html#finish())is called. If no entry Transition was used, finish() is called immediately and the Activity exit Transition is run.

On Android 4.4 or lower, this method only finishes the Activity with no special exit transition.

<br />

<br />

|          Parameters           ||
|------------|-------------------|
| `activity` | `Activity` <br /> |

### getReferrer

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

```
Uri getReferrer (Activity activity)
```

Return information about who launched this activity. If the launching Intent contains an[Intent.EXTRA_REFERRER](https://developer.android.com/reference/android/content/Intent.html#EXTRA_REFERRER), that will be returned as-is; otherwise, if known, an[android-app:](https://developer.android.com/reference/android/content/Intent.html#URI_ANDROID_APP_SCHEME)referrer URI containing the package name that started the Intent will be returned. This may return null if no referrer can be identified -- it is neither explicitly specified, nor is it known which application package was involved.

If called while inside the handling of[onNewIntent(Intent)](https://developer.android.com/reference/android/app/Activity.html#onNewIntent(android.content.Intent)), this function will return the referrer that submitted that new intent to the activity. Otherwise, it always returns the referrer of the original Intent.

Note that this is*not*a security feature -- you can not trust the referrer information, applications can spoof it.

<br />

<br />

|          Parameters           ||
|------------|-------------------|
| `activity` | `Activity` <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### invalidateOptionsMenu

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

```
boolean invalidateOptionsMenu (Activity activity)
```

<br />

**This method was deprecated in API level 27.1.0.**   
Use[invalidateOptionsMenu()](https://developer.android.com/reference/android/app/Activity.html#invalidateOptionsMenu())directly.

Invalidate the activity's options menu, if able.

Before API level 11 (Android 3.0/Honeycomb) the lifecycle of the options menu was controlled primarily by the user's operation of the hardware menu key. When the user presses down on the menu key for the first time the menu was created and prepared by calls to[onCreateOptionsMenu(android.view.Menu)](https://developer.android.com/reference/android/app/Activity.html#onCreateOptionsMenu(android.view.Menu))and[onPrepareOptionsMenu(android.view.Menu)](https://developer.android.com/reference/android/app/Activity.html#onPrepareOptionsMenu(android.view.Menu))respectively. Subsequent presses of the menu key kept the existing instance of the Menu itself and called[onPrepareOptionsMenu(android.view.Menu)](https://developer.android.com/reference/android/app/Activity.html#onPrepareOptionsMenu(android.view.Menu))to give the activity an opportunity to contextually alter the menu before the menu panel was shown.

In Android 3.0+ the Action Bar forces the options menu to be built early so that items chosen to show as actions may be displayed when the activity first becomes visible. The Activity method invalidateOptionsMenu forces the entire menu to be destroyed and recreated from[onCreateOptionsMenu(android.view.Menu)](https://developer.android.com/reference/android/app/Activity.html#onCreateOptionsMenu(android.view.Menu)), offering a similar though heavier-weight opportunity to change the menu's contents. Normally this functionality is used to support a changing configuration of Fragments.

Applications may use this support helper to signal a significant change in activity state that should cause the options menu to be rebuilt. If the app is running on an older platform version that does not support menu invalidation the app will still receive[onPrepareOptionsMenu(android.view.Menu)](https://developer.android.com/reference/android/app/Activity.html#onPrepareOptionsMenu(android.view.Menu))the next time the user presses the menu key and this method will return false. If this method returns true the options menu was successfully invalidated.

<br />

<br />

|                                 Parameters                                  ||
|------------|-----------------------------------------------------------------|
| `activity` | `Activity`: Invalidate the options menu of this activity <br /> |

|                                                 Returns                                                 ||
|-----------|----------------------------------------------------------------------------------------------|
| `boolean` | true if this operation was supported and it completed; false if it was not available. <br /> |

### postponeEnterTransition

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

```
void postponeEnterTransition (Activity activity)
```

<br />

<br />

|          Parameters           ||
|------------|-------------------|
| `activity` | `Activity` <br /> |

### requestDragAndDropPermissions

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

```
DragAndDropPermissionsCompat requestDragAndDropPermissions (Activity activity,
                DragEvent dragEvent)
```

Create[DragAndDropPermissionsCompat](https://developer.android.com/reference/android/support/v13/view/DragAndDropPermissionsCompat)object bound to this activity and controlling the access permissions for content URIs associated with the[DragEvent](https://developer.android.com/reference/android/view/DragEvent.html).

<br />

|                              Parameters                               ||
|-------------|----------------------------------------------------------|
| `activity`  | `Activity` <br />                                        |
| `dragEvent` | `DragEvent`: Drag event to request permission for <br /> |

|                                                                                                                                                                                                        Returns                                                                                                                                                                                                         ||
|-------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DragAndDropPermissionsCompat](https://developer.android.com/reference/android/support/v13/view/DragAndDropPermissionsCompat) | The[DragAndDropPermissionsCompat](https://developer.android.com/reference/android/support/v13/view/DragAndDropPermissionsCompat)object used to control access to the content URIs.`null`if no content URIs are associated with the event or if permissions could not be granted. <br /> |

### requestPermissions

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

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

Requests permissions to be granted to this application. These permissions must be requested in your manifest, they should not be granted to your app, and they should have protection level[#PROTECTION_DANGEROUS dangerous](https://developer.android.com/reference/android/content/pm/PermissionInfo.html), regardless whether they are declared by the platform or a third-party app.

Normal permissions[PROTECTION_NORMAL](https://developer.android.com/reference/android/content/pm/PermissionInfo.html#PROTECTION_NORMAL)are granted at install time if requested in the manifest. Signature permissions[PROTECTION_SIGNATURE](https://developer.android.com/reference/android/content/pm/PermissionInfo.html#PROTECTION_SIGNATURE)are granted at install time if requested in the manifest and the signature of your app matches the signature of the app declaring the permissions.

If your app does not have the requested permissions the user will be presented with UI for accepting them. After the user has accepted or rejected the requested permissions you will receive a callback reporting whether the permissions were granted or not. Your activity has to implement[ActivityCompat.OnRequestPermissionsResultCallback](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback)and the results of permission requests will be delivered to its[onRequestPermissionsResult(int, String[], int[])](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback#onRequestPermissionsResult(int, java.lang.String[], int[]))method.

Note that requesting a permission does not guarantee it will be granted and your app should be able to run without having this permission.

This method may start an activity allowing the user to choose which permissions to grant and which to reject. Hence, you should be prepared that your activity may be paused and resumed. Further, granting some permissions may require a restart of you application. In such a case, the system will recreate the activity stack before delivering the result to your[onRequestPermissionsResult(int, String[], int[])](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback#onRequestPermissionsResult(int, java.lang.String[], int[])).

When checking whether you have a permission you should use[checkSelfPermission(android.content.Context, String)](https://developer.android.com/reference/android/support/v4/content/ContextCompat#checkSelfPermission(android.content.Context, java.lang.String)).

Calling this API for permissions already granted to your app would show UI to the user to decided whether the app can still hold these permissions. This can be useful if the way your app uses the data guarded by the permissions changes significantly.

You cannot request a permission if your activity sets[noHistory](https://developer.android.com/reference/android/R.attr#noHistory)to`true`in the manifest because in this case the activity would not receive result callbacks including[onRequestPermissionsResult(int, String[], int[])](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback#onRequestPermissionsResult(int, java.lang.String[], int[])).

The[RuntimePermissions](http://developer.android.com/samples/RuntimePermissions/index.html)sample app demonstrates how to use this method to request permissions at run time.

<br />

<br />

|                                                                                                                                                                     Parameters                                                                                                                                                                     ||
|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `activity`    | `Activity`: The target activity. <br />                                                                                                                                                                                                                                                                                             |
| `permissions` | `String`: The requested permissions. Must be 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 /> |

**See also:**

- [onRequestPermissionsResult(int, String[], int[])](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback#onRequestPermissionsResult(int, java.lang.String[], int[]))
- [checkSelfPermission(android.content.Context, String)](https://developer.android.com/reference/android/support/v4/content/ContextCompat#checkSelfPermission(android.content.Context, java.lang.String))
- [shouldShowRequestPermissionRationale(android.app.Activity, String)](https://developer.android.com/reference/android/support/v4/app/ActivityCompat#shouldShowRequestPermissionRationale(android.app.Activity, java.lang.String))  

### requireViewById

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

```
T requireViewById (Activity activity,
                int id)
```

Finds a view that was identified by the`android:id`XML attribute that was processed in[onCreate(Bundle)](https://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle)), or throws an IllegalArgumentException if the ID is invalid, or there is no matching view in the hierarchy.

**Note:**In most cases -- depending on compiler support -- the resulting view is automatically cast to the target class type. If the target class type is unconstrained, an explicit cast may be necessary.

<br />

|                   Parameters                   ||
|------------|------------------------------------|
| `activity` | `Activity` <br />                  |
| `id`       | `int`: the ID to search for <br /> |

|             Returns              ||
|-----|-----------------------------|
| `T` | a view with given ID <br /> |

**See also:**

- [findViewById(int)](https://developer.android.com/reference/android/app/Activity.html#findViewById(int))
- [requireViewById(View, int)](https://developer.android.com/reference/android/support/v4/view/ViewCompat#requireViewById(android.view.View, int))  

### setEnterSharedElementCallback

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

```
void setEnterSharedElementCallback (Activity activity,
                SharedElementCallback callback)
```

When[makeSceneTransitionAnimation(Activity, android.view.View, String)](https://developer.android.com/reference/android/app/ActivityOptions.html#makeSceneTransitionAnimation(android.app.Activity, android.view.View, java.lang.String))was used to start an Activity,<var translate="no">callback</var>will be called to handle shared elements on the*launched* Activity. This requires[FEATURE_CONTENT_TRANSITIONS](https://developer.android.com/reference/android/view/Window.html#FEATURE_CONTENT_TRANSITIONS).

<br />

|                                                     Parameters                                                      ||
|------------|---------------------------------------------------------------------------------------------------------|
| `activity` | `Activity` <br />                                                                                       |
| `callback` | `SharedElementCallback`: Used to manipulate shared element transitions on the launched Activity. <br /> |

### setExitSharedElementCallback

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

```
void setExitSharedElementCallback (Activity activity,
                SharedElementCallback callback)
```

When[makeSceneTransitionAnimation(Activity, android.view.View, String)](https://developer.android.com/reference/android/app/ActivityOptions.html#makeSceneTransitionAnimation(android.app.Activity, android.view.View, java.lang.String))was used to start an Activity,<var translate="no">callback</var>will be called to handle shared elements on the*launching* Activity. Most calls will only come when returning from the started Activity. This requires[FEATURE_CONTENT_TRANSITIONS](https://developer.android.com/reference/android/view/Window.html#FEATURE_CONTENT_TRANSITIONS).

<br />

|                                                      Parameters                                                      ||
|------------|----------------------------------------------------------------------------------------------------------|
| `activity` | `Activity` <br />                                                                                        |
| `callback` | `SharedElementCallback`: Used to manipulate shared element transitions on the launching Activity. <br /> |

### setPermissionCompatDelegate

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

```
void setPermissionCompatDelegate (ActivityCompat.PermissionCompatDelegate delegate)
```

Sets the permission delegate for`ActivityCompat`. Replaces the previously set delegate.

<br />

|                                                      Parameters                                                       ||
|------------|-----------------------------------------------------------------------------------------------------------|
| `delegate` | `ActivityCompat.PermissionCompatDelegate`: The delegate to be set.`null`to clear the set delegate. <br /> |

### shouldShowRequestPermissionRationale

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

```
boolean shouldShowRequestPermissionRationale (Activity activity,
                String permission)
```

Gets whether you should show UI with rationale for requesting a permission. You should do this only if you do not have the permission and the context in which the permission is requested does not clearly communicate to the user what would be the benefit from granting this permission.

For example, if you write a camera app, requesting the camera permission would be expected by the user and no rationale for why it is requested is needed. If however, the app needs location for tagging photos then a non-tech savvy user may wonder how location is related to taking photos. In this case you may choose to show UI with rationale of requesting this permission.

<br />

<br />

|                               Parameters                               ||
|--------------|----------------------------------------------------------|
| `activity`   | `Activity`: The target activity. <br />                  |
| `permission` | `String`: A permission your app wants to request. <br /> |

|                             Returns                             ||
|-----------|------------------------------------------------------|
| `boolean` | Whether you can show permission rationale UI. <br /> |

**See also:**

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

### startActivityForResult

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

```
void startActivityForResult (Activity activity,
                Intent intent,
                int requestCode, 
                Bundle options)
```

Start new activity with options, if able, for which you would like a result when it finished.

In Android 4.1+ additional options were introduced to allow for more control on activity launch animations. Applications can use this method along with[ActivityOptionsCompat](https://developer.android.com/reference/android/support/v4/app/ActivityOptionsCompat)to use these animations when available. When run on versions of the platform where this feature does not exist the activity will be launched normally.

<br />

<br />

|                                                                                                                                                                       Parameters                                                                                                                                                                        ||
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `activity`    | `Activity`: Origin activity to launch from. <br />                                                                                                                                                                                                                                                                                       |
| `intent`      | `Intent`: The description of the activity to start. <br />                                                                                                                                                                                                                                                                               |
| `requestCode` | `int`: If \>= 0, this code will be returned in onActivityResult() when the activity exits. <br />                                                                                                                                                                                                                                        |
| `options`     | `Bundle`: Additional options for how the Activity should be started. May be null if there are no options. See[ActivityOptionsCompat](https://developer.android.com/reference/android/support/v4/app/ActivityOptionsCompat)for how to build the Bundle supplied here; there are no supported definitions for building it manually. <br /> |

### startIntentSenderForResult

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

```
void startIntentSenderForResult (Activity activity,
                IntentSender intent,
                int requestCode, 
                Intent fillInIntent,
                int flagsMask, 
                int flagsValues, 
                int extraFlags, 
                Bundle options)
```

Start new IntentSender with options, if able, for which you would like a result when it finished.

In Android 4.1+ additional options were introduced to allow for more control on activity launch animations. Applications can use this method along with[ActivityOptionsCompat](https://developer.android.com/reference/android/support/v4/app/ActivityOptionsCompat)to use these animations when available. When run on versions of the platform where this feature does not exist the activity will be launched normally.

<br />

<br />

|                                                                                                                                                                                  Parameters                                                                                                                                                                                  ||
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `activity`     | `Activity`: Origin activity to launch from. <br />                                                                                                                                                                                                                                                                                                           |
| `intent`       | `IntentSender`: The IntentSender to launch. <br />                                                                                                                                                                                                                                                                                                           |
| `requestCode`  | `int`: If \>= 0, this code will be returned in onActivityResult() when the activity exits. <br />                                                                                                                                                                                                                                                            |
| `fillInIntent` | `Intent`: If non-null, this will be provided as the intent parameter to[sendIntent(Context, int, Intent, IntentSender.OnFinished, Handler)](https://developer.android.com/reference/android/content/IntentSender.html#sendIntent(android.content.Context, int, android.content.Intent, android.content.IntentSender.OnFinished, android.os.Handler)). <br /> |
| `flagsMask`    | `int`: Intent flags in the original IntentSender that you would like to change. <br />                                                                                                                                                                                                                                                                       |
| `flagsValues`  | `int`: Desired values for any bits set in<var translate="no">flagsMask</var> <br />                                                                                                                                                                                                                                                                          |
| `extraFlags`   | `int`: Always set to 0. <br />                                                                                                                                                                                                                                                                                                                               |
| `options`      | `Bundle`: Additional options for how the Activity should be started. May be null if there are no options. See[ActivityOptionsCompat](https://developer.android.com/reference/android/support/v4/app/ActivityOptionsCompat)for how to build the Bundle supplied here; there are no supported definitions for building it manually. <br />                     |

|                                                                Throws                                                                ||
|-----------------------------------------------------------------------------------------------------------------------------------|---|
| [IntentSender.SendIntentException](https://developer.android.com/reference/android/content/IntentSender.SendIntentException.html) |   |

### startPostponedEnterTransition

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

```
void startPostponedEnterTransition (Activity activity)
```

<br />

<br />

|          Parameters           ||
|------------|-------------------|
| `activity` | `Activity` <br /> |

-

  ## 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)