ContextCompat

public class ContextCompat

Known direct subclasses
ActivityCompat

Helper for accessing features in android.app.Activity.


Helper for accessing features in Context.

Summary

Public constructors

Public methods

static int

Determine whether you have been granted a particular permission.

static @Nullable Context

Return a new Context object for the current Context but whose storage APIs are backed by device-protected storage.

static @Nullable String

Attribution can be used in complex apps to logically separate parts of the app.

static @NonNull File

Returns the absolute path to the application specific cache directory on the filesystem designed for storing cached code.

static @ColorInt int
getColor(@NonNull Context context, @ColorRes int id)

Returns a color associated with a particular resource ID

static @Nullable ColorStateList

Returns a color state list associated with a particular resource ID.

static @Nullable File

Returns the absolute path to the directory on the filesystem where all private files belonging to this app are stored.

static @Nullable Drawable
getDrawable(@NonNull Context context, @DrawableRes int id)

Returns a drawable object associated with a particular resource ID.

static File[]

Returns absolute paths to application-specific directories on all external storage devices where the application can place cache files it owns.

static File[]

Returns absolute paths to application-specific directories on all external storage devices where the application can place persistent files it owns.

static @NonNull Executor