ActivityCompat
public
class
ActivityCompat
extends ActivityCompat
Helper for accessing features in Activity
introduced after API level 13 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.
|
Uri
|
getReferrer(Activity activity)
Backwards compatible implementation of Activity.getReferrer .
|
static
boolean
|
invalidateOptionsMenu(Activity activity)
Invalidate the activity's options menu, if able.
|
static
void
|
postponeEnterTransition(Activity activity)
|
static
void
|
requestPermissions(Activity activity, String[] permissions, int requestCode)
Requests permissions to be granted to this application.
|
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, callback
will be called to handle shared elements on the launching Activity.
|
static
boolean
|
shouldShowRequestPermissionRationale(Activity activity, String permission)
Gets whether you should show UI with rationale for requesting a permission.
|
static
void
|
startActivity(Activity activity, Intent intent, Bundle options)
Start an activity with additional launch information, if able.
|
static
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.
|
static
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.
|
static
void
|
startPostponedEnterTransition(Activity activity)
|
|
From
class
android.support.v4.content.ContextCompat
static
int
|
checkSelfPermission(Context context, String permission)
Determine whether you have been granted a particular permission.
|
static
Context
|
createDeviceProtectedStorageContext(Context context)
Return a new Context object for the current Context but whose storage
APIs are backed by device-protected storage.
|
static
File
|
getCodeCacheDir(Context context)
Returns the absolute path to the application specific cache directory on
the filesystem designed for storing cached code.
|
static
final
int
|
getColor(Context context, int id)
Returns a color associated with a particular resource ID
Starting in M , the returned
color will be styled for the specified Context's theme.
|
static
final
ColorStateList
|
getColorStateList(Context context, int id)
Returns a color state list associated with a particular resource ID.
|
static
File
|
getDataDir(Context context)
Returns the absolute path to the directory on the filesystem where all
private files belonging to this app are stored.
|
static
final
Drawable
|
getDrawable(Context context, int id)
Returns a drawable object associated with a particular resource ID.
|
static
File[]
|
getExternalCacheDirs(Context 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(Context 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
final
File
|
getNoBackupFilesDir(Context context)
Returns the absolute path to the directory on the filesystem similar to
getFilesDir() .
|
static
File[]
|
getObbDirs(Context 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
boolean
|
isDeviceProtectedStorage(Context context)
Indicates if the storage APIs of this Context are backed by
device-encrypted storage.
|
static
boolean
|
startActivities(Context context, Intent[] intents, Bundle options)
Start a set of activities as a synthesized task stack, if able.
|
static
boolean
|
startActivities(Context context, Intent[] intents)
Start a set of activities as a synthesized task stack, if able.
|
|
From
class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long millis, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long millis)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
|
Public methods