ActivityCompat
This package is part of the
Android support library which
is no longer maintained.
The support library has been superseded by AndroidX
which is part of Jetpack .
We recommend using the AndroidX libraries in all new projects. You should also consider
migrating existing projects to AndroidX.
To find the AndroidX class that maps to this deprecated class, see the AndroidX
support library class
mappings .
public
class
ActivityCompat
extends ActivityCompat
This class was deprecated
in API level 27.1.0.
Use android.support.v4.app.ActivityCompat
.
Helper for accessing features in Activity
in a backwards compatible fashion.
Summary
Inherited methods
From
class
android.support.v4.app.ActivityCompat
static
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.
static
void
finishAfterTransition (Activity activity)
Reverses the Activity Scene entry Transition and triggers the calling Activity
to reverse its exit Transition.
static
Uri
getReferrer (Activity activity)
Return information about who launched this activity.
static
boolean
invalidateOptionsMenu (Activity activity)
This method was deprecated
in API level 27.1.0.
Use invalidateOptionsMenu()
directly.
static
void
postponeEnterTransition (Activity activity)
static
DragAndDropPermissionsCompat
requestDragAndDropPermissions (Activity activity, DragEvent dragEvent)
Create DragAndDropPermissionsCompat
object bound to this activity and controlling
the access permissions for content URIs associated with the DragEvent
.
static
void
requestPermissions (Activity activity, String[] permissions, int requestCode)
Requests permissions to be granted to this application.
static
<T extends View >
T
requireViewById (Activity activity, int id)
Finds a view that was identified by the android:id
XML attribute that was processed
in onCreate(Bundle)
, or throws an IllegalArgumentException if the ID is invalid, or
there is no matching view in the hierarchy.
static
void
setEnterSharedElementCallback (Activity activity, SharedElementCallback callback)
When makeSceneTransitionAnimation(Activity, android.view.View, String)
was used to start an Activity, callback
will be called to handle shared elements on the launched Activity.
static
void
setExitSharedElementCallback (Activity activity, SharedElementCallback callback)
When makeSceneTransitionAnimation(Activity, android.view.View, String)
was used to start an Activity,