Java android.content.res Resources fields, constructors, methods, implement or subclass

Example usage for Java android.content.res Resources fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.content.res Resources.

The text is from its open source code.

Subclass

android.content.res.Resources has subclasses.
Click this link to see all its subclasses.

Constructor

Resources(AssetManager assets, DisplayMetrics metrics, Configuration config)
Create a new Resources object on top of an existing set of assets in an AssetManager.

Method

XmlResourceParsergetAnimation(@AnimatorRes @AnimRes int id)
Return an XmlResourceParser through which you can read an animation description for the given resource ID.
AssetManagergetAssets()
Retrieve underlying AssetManager storage for these resources.
booleangetBoolean(@BoolRes int id)
Return a boolean associated with a particular resource ID.
intgetColor(@ColorRes int id)
Returns a color integer associated with a particular resource ID.
intgetColor(@ColorRes int id, @Nullable Theme theme)
Returns a themed color integer associated with a particular resource ID.
ColorStateListgetColorStateList(@ColorRes int id)
Returns a color state list associated with a particular resource ID.
ColorStateListgetColorStateList(@ColorRes int id, @Nullable Theme theme)
Returns a themed color state list associated with a particular resource ID.
ConfigurationgetConfiguration()
Return the current configuration that is in effect for this resource object.
floatgetDimension(@DimenRes int id)
Retrieve a dimensional for a particular resource ID.
intgetDimensionPixelOffset(@DimenRes int id)
Retrieve a dimensional for a particular resource ID for use as an offset in raw pixels.
intgetDimensionPixelSize(@DimenRes int id)
Retrieve a dimensional for a particular resource ID for use as a size in raw pixels.
DisplayMetricsgetDisplayMetrics()
Return the current display metrics that are in effect for this resource object.
DrawablegetDrawable(@DrawableRes int id)
Return a drawable object associated with a particular resource ID.
DrawablegetDrawable(@DrawableRes int id, @Nullable Theme theme)
Return a drawable object associated with a particular resource ID and styled for the specified theme.
DrawablegetDrawableForDensity(@DrawableRes int id, int density, @Nullable Theme theme)
Return a drawable object associated with a particular resource ID for the given screen density in DPI and styled for the specified theme.
DrawablegetDrawableForDensity(@DrawableRes int id, int density)
Return a drawable object associated with a particular resource ID for the given screen density in DPI.
floatgetFraction(@FractionRes int id, int base, int pbase)
Retrieve a fractional unit for a particular resource ID.
intgetIdentifier(String name, String defType, String defPackage)
Return a resource identifier for the given resource name.
int[]getIntArray(@ArrayRes int id)
Return the int array associated with a particular resource ID.
intgetInteger(@IntegerRes int id)
Return an integer associated with a particular resource ID.
MoviegetMovie(@RawRes int id)
Return a movie object associated with the particular resource ID.
StringgetQuantityString(@PluralsRes int id, int quantity, Object... formatArgs)
Formats the string necessary for grammatically correct pluralization of the given resource ID for the given quantity, using the given arguments.
StringgetQuantityString(@PluralsRes int id, int quantity)
Returns the string necessary for grammatically correct pluralization of the given resource ID for the given quantity.
CharSequencegetQuantityText(@PluralsRes int id, int quantity)
Returns the character sequence necessary for grammatically correct pluralization of the given resource ID for the given quantity.
StringgetResourceEntryName(@AnyRes int resid)
Return the entry name for a given resource identifier.
StringgetResourceName(@AnyRes int resid)
Return the full name for a given resource identifier.
StringgetResourcePackageName(@AnyRes int resid)
Return the package name for a given resource identifier.
StringgetResourceTypeName(@AnyRes int resid)
Return the type name for a given resource identifier.
StringgetString(@StringRes int id)
Return the string value associated with a particular resource ID.
StringgetString(@StringRes int id, Object... formatArgs)
Return the string value associated with a particular resource ID, substituting the format arguments as defined in java.util.Formatter and java.lang.String#format .
String[]getStringArray(@ArrayRes int id)
Return the string array associated with a particular resource ID.
ResourcesgetSystem()
Return a global shared Resources object that provides access to only system resources (no application resources), and is not configured for the current screen (can not use dimension units, does not change based on orientation, etc).
CharSequencegetText(@StringRes int id)
Return the string value associated with a particular resource ID.
CharSequence[]getTextArray(@ArrayRes int id)
Return the styled text array associated with a particular resource ID.
voidgetValue(@AnyRes int id, TypedValue outValue, boolean resolveRefs)
Return the raw data associated with a particular resource ID.
voidgetValue(String name, TypedValue outValue, boolean resolveRefs)
Return the raw data associated with a particular resource ID.
voidgetValueForDensity(@AnyRes int id, int density, TypedValue outValue, boolean resolveRefs)
Get the raw value associated with a resource with associated density.
XmlResourceParsergetXml(@XmlRes int id)
Return an XmlResourceParser through which you can read a generic XML resource for the given resource ID.
ThemenewTheme()
Generate a new Theme object for this set of Resources.
TypedArrayobtainAttributes(AttributeSet set, @StyleableRes int[] attrs)
Retrieve a set of basic attribute values from an AttributeSet, not performing styling of them using a theme and/or style resources.
TypedArrayobtainTypedArray(@ArrayRes int id)
Return an array of heterogeneous values.
InputStreamopenRawResource(@RawRes int id)
Open a data stream for reading a raw resource.
InputStreamopenRawResource(@RawRes int id, TypedValue value)
Open a data stream for reading a raw resource.
AssetFileDescriptoropenRawResourceFd(@RawRes int id)
Open a file descriptor for reading a raw resource.
voidparseBundleExtra(String tagName, AttributeSet attrs, Bundle outBundle)
Parse a name/value pair out of an XML tag holding that data.
voidupdateConfiguration(Configuration config, DisplayMetrics metrics)
Store the newly updated configuration.