assets Previously created AssetManager.metrics Current display metrics to consider when
selecting/computing resource values.config Desired device configuration to consider when
selecting/computing resource values (optional).assets Previously created AssetManager.metrics Current display metrics to consider when
selecting/computing resource values.config Desired device configuration to consider when
selecting/computing resource values (optional).compInfo this resource's compatibility info. It will use the default compatibility
info when it's null.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.java.util.Formatter
and java.lang.String.format(java.lang.String,java.lang.Object[]). It will be stripped of any styled text
information.
id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.formatArgs The format arguments that will be used for substitution.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.java.util.Formatter and java.lang.String.format(java.lang.String,java.lang.Object[]). It will be
stripped of any styled text information.
id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.quantity The number used to get the correct string for the current language's
plural rules.formatArgs The format arguments that will be used for substitution.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.quantity The number used to get the correct string for the current language's
plural rules.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.def The default CharSequence to return.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.TypedArray.recycle()
when done with it.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.android.util.DisplayMetrics associated
with the resources.
id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.getDimensionPixelOffset(int)getDimensionPixelSize(int)getDimension(int), except the returned value is converted to
integer pixels for you. An offset conversion involves simply
truncating the base value to an integer.
id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.getDimension(int)getDimensionPixelSize(int)getDimension(int), except the returned value is converted to
integer pixels for use as a size. A size conversion involves
rounding the base value, and ensuring that a non-zero base value
is at least one pixel in size.
id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.getDimension(int)getDimensionPixelOffset(int)id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.base The base value of this fraction. In other words, a
standard fraction is multiplied by this value.pbase The parent base value of this fraction. In other
words, a parent fraction (nn%p) is multiplied by this
value.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.ColorStateList, then the default color from
the set is returned.
id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.ColorStateList holding multiple possible colors.
id The desired resource identifier of a ColorStateList,
as generated by the aapt tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.This function is really a simple wrapper for calling
with a layout resource.
getXml(int)
id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.getXml(int)This function is really a simple wrapper for calling
with an animation resource.
getXml(int)
id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.getXml(int)The XmlPullParser implementation returned here has some limited functionality. In particular, you can't change its input, and only high-level parsing events are available (since the document was pre-parsed for you at build time, which involved merging text and stripping comments).
id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.android.util.AttributeSetid The resource identifier to open, as generated by the appt
tool.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.id The resource identifier to open, as generated by the appt tool.value The TypedValue object to hold the resource information.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.This function only works for resources that are stored in the package as uncompressed data, which typically includes things like mp3 files and png images.
id The resource identifier to open, as generated by the appt
tool.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.id The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.outValue Object in which to place the resource data.resolveRefs If true, a resource that is a reference to another
resource will be followed so that you receive the
actual final resource data. If false, the TypedValue
will be filled in with the reference itself.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.Note: use of this function is discouraged. It is much more efficient to retrieve resources by identifier than by name.
name The name of the desired resource. This is passed to
getIdentifier() with a default type of "string".outValue Object in which to place the resource data.resolveRefs If true, a resource that is a reference to another
resource will be followed so that you receive the
actual final resource data. If false, the TypedValue
will be filled in with the reference itself.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.TypedArray
to resolve the final value for an attribute.
The Theme's attributes come into play in two ways: (1) a styled attribute can explicit reference a value in the theme through the "?themeAttribute" syntax; (2) if no value has been defined for a particular styled attribute, as a last resort we will try to find that attribute's value in the Theme.
You will normally use the APIs to
retrieve XML attributes with style and theme information applied.
obtainStyledAttributes(int[])
The semantics of this function depends on the force argument: If false, only values that are not already defined in the theme will be copied from the system resource; otherwise, if any of the style's attributes are already defined in the theme, the current values in the theme will be overwritten.
resid The resource ID of a style resource from which to
obtain attribute values.force If true, values in the style resource will always be
used in the theme; otherwise, they will only be used
if not already defined in the theme.other The existing Theme to copy from.Be sure to call StyledAttributes.recycle() when you are done with the array.
attrs The desired attributes.TypedArray.recycle()
when done with it.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.Resources.obtainAttributes(android.util.AttributeSet,int[])obtainStyledAttributes(int,int[])obtainStyledAttributes(android.util.AttributeSet,int[],int,int)Be sure to call StyledAttributes.recycle() when you are done with the array.
resid The desired style resource.attrs The desired attributes in the style.TypedArray.recycle()
when done with it.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.Resources.obtainAttributes(android.util.AttributeSet,int[])obtainStyledAttributes(int[])obtainStyledAttributes(android.util.AttributeSet,int[],int,int)Be sure to call StyledAttributes.recycle() when you are done with the array.
When determining the final value of a particular attribute, there are four inputs that come into play:
Each of these inputs is considered in-order, with the first listed
taking precedence over the following ones. In other words, if in the
AttributeSet you have supplied <Button
textColor="#ff000000">, then the button's text will
always be black, regardless of what is specified in any of
the styles.
set The base set of attribute values. May be null.attrs The desired attributes to be retrieved.defStyleAttr An attribute in the current theme that contains a
reference to a style resource that supplies
defaults values for the StyledAttributes. Can be
0 to not look for defaults.defStyleRes A resource identifier of a style resource that
supplies default values for the StyledAttributes,
used only if defStyleAttr is 0 or can not be found
in the theme. Can be 0 to not look for defaults.TypedArray.recycle()
when done with it.Resources.obtainAttributes(android.util.AttributeSet,int[])obtainStyledAttributes(int[])obtainStyledAttributes(int,int[])Resources.getValue(int,android.util.TypedValue,boolean).
resid The resource identifier of the desired theme
attribute.outValue Filled in with the ultimate resource value supplied
by the attribute.resolveRefs If true, resource references will be walked; if
false, outValue may be a
TYPE_REFERENCE. In either case, it will never
be a TYPE_ATTRIBUTE.set The current attribute values to retrieve.attrs The specific attributes to be retrieved.TypedArray.recycle()
when done with it.Resources.Theme.obtainStyledAttributes(android.util.AttributeSet,int[],int,int)Note: use of this function is discouraged. It is much more efficient to retrieve resources by identifier than by name.
name The name of the desired resource.defType Optional default resource type to find, if "type/" is
not included in the name. Can be null to require an
explicit type.defPackage Optional default package to find, if "package:" is
not included in the name. Can be null to require an
explicit package.resid The resource identifier whose name is to be retrieved.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.getResourcePackageName(int)getResourceTypeName(int)getResourceEntryName(int)resid The resource identifier whose package name is to be
retrieved.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.getResourceName(int)resid The resource identifier whose type name is to be
retrieved.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.getResourceName(int)resid The resource identifier whose entry name is to be
retrieved.Resources.NotFoundException Throws NotFoundException if the given ID does not exist.getResourceName(int)<extra> tags from
an XML file. You call this when you are at the parent tag of the
extra tags, and it return once all of the child tags have been parsed.
This will call parseBundleExtra(java.lang.String,android.util.AttributeSet,android.os.Bundle) for each extra tag encountered.
parser The parser from which to retrieve the extras.outBundle A Bundle in which to place all parsed extras.org.xmlpull.v1.XmlPullParserExceptionjava.io.IOExceptionandroid.R.styleable. The following value types are supported:
android.util.TypedValue.TYPE_STRING:
Bundle.putCharSequence()
android.util.TypedValue.TYPE_INT_BOOLEAN:
Bundle.putBoolean()
android.util.TypedValue.TYPE_FIRST_INT-android.util.TypedValue.TYPE_LAST_INT:
Bundle.putBoolean()
android.util.TypedValue.TYPE_FLOAT:
Bundle.putFloat()
tagName The name of the tag these attributes come from; this is
only used for reporting error messages.attrs The attributes from which to retrieve the name/value pair.outBundle The Bundle in which to place the parsed value.org.xmlpull.v1.XmlPullParserException If the attributes are not valid.