android.content.res
Class Resources
java.lang.Object
android.content.res.Resources
public class Resources
- extends Object
Method Summary |
void |
finishPreloading()
|
void |
flushLayoutCache()
|
XmlResourceParser |
getAnimation(int id)
|
AssetManager |
getAssets()
|
boolean |
getBoolean(int id)
|
int |
getColor(int id)
|
ColorStateList |
getColorStateList(int id)
|
Configuration |
getConfiguration()
|
float |
getDimension(int id)
|
int |
getDimensionPixelOffset(int id)
|
int |
getDimensionPixelSize(int id)
|
DisplayMetrics |
getDisplayMetrics()
|
Drawable |
getDrawable(int id)
|
float |
getFraction(int id,
int base,
int pbase)
|
int |
getIdentifier(String name,
String defType,
String defPackage)
|
int[] |
getIntArray(int id)
|
int |
getInteger(int id)
|
XmlResourceParser |
getLayout(int id)
|
Movie |
getMovie(int id)
|
String |
getQuantityString(int id,
int quantity)
|
String |
getQuantityString(int id,
int quantity,
Object... formatArgs)
|
CharSequence |
getQuantityText(int id,
int quantity)
|
String |
getResourceEntryName(int resid)
|
String |
getResourceName(int resid)
|
String |
getResourcePackageName(int resid)
|
String |
getResourceTypeName(int resid)
|
String |
getString(int id)
|
String |
getString(int id,
Object... formatArgs)
|
String[] |
getStringArray(int id)
|
static Resources |
getSystem()
|
CharSequence |
getText(int id)
|
CharSequence |
getText(int id,
CharSequence def)
|
CharSequence[] |
getTextArray(int id)
|
void |
getValue(int id,
TypedValue outValue,
boolean resolveRefs)
|
void |
getValue(String name,
TypedValue outValue,
boolean resolveRefs)
|
XmlResourceParser |
getXml(int id)
|
Resources.Theme |
newTheme()
|
TypedArray |
obtainAttributes(AttributeSet set,
int[] attrs)
|
TypedArray |
obtainTypedArray(int id)
|
InputStream |
openRawResource(int id)
|
InputStream |
openRawResource(int id,
TypedValue value)
|
AssetFileDescriptor |
openRawResourceFd(int id)
|
void |
parseBundleExtra(String tagName,
AttributeSet attrs,
Bundle outBundle)
|
void |
parseBundleExtras(XmlResourceParser parser,
Bundle outBundle)
|
void |
updateConfiguration(Configuration config,
DisplayMetrics metrics)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Resources
public Resources(AssetManager assets,
DisplayMetrics metrics,
Configuration config)
getSystem
public static Resources getSystem()
getText
public CharSequence getText(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getQuantityText
public CharSequence getQuantityText(int id,
int quantity)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getString
public String getString(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getString
public String getString(int id,
Object... formatArgs)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getQuantityString
public String getQuantityString(int id,
int quantity,
Object... formatArgs)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getQuantityString
public String getQuantityString(int id,
int quantity)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getText
public CharSequence getText(int id,
CharSequence def)
getTextArray
public CharSequence[] getTextArray(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getStringArray
public String[] getStringArray(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getIntArray
public int[] getIntArray(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
obtainTypedArray
public TypedArray obtainTypedArray(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getDimension
public float getDimension(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getDimensionPixelOffset
public int getDimensionPixelOffset(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getDimensionPixelSize
public int getDimensionPixelSize(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getFraction
public float getFraction(int id,
int base,
int pbase)
getDrawable
public Drawable getDrawable(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getMovie
public Movie getMovie(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getColor
public int getColor(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getColorStateList
public ColorStateList getColorStateList(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getBoolean
public boolean getBoolean(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getInteger
public int getInteger(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getLayout
public XmlResourceParser getLayout(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getAnimation
public XmlResourceParser getAnimation(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getXml
public XmlResourceParser getXml(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
openRawResource
public InputStream openRawResource(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
openRawResource
public InputStream openRawResource(int id,
TypedValue value)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
openRawResourceFd
public AssetFileDescriptor openRawResourceFd(int id)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getValue
public void getValue(int id,
TypedValue outValue,
boolean resolveRefs)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getValue
public void getValue(String name,
TypedValue outValue,
boolean resolveRefs)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
newTheme
public final Resources.Theme newTheme()
obtainAttributes
public TypedArray obtainAttributes(AttributeSet set,
int[] attrs)
updateConfiguration
public void updateConfiguration(Configuration config,
DisplayMetrics metrics)
getDisplayMetrics
public DisplayMetrics getDisplayMetrics()
getConfiguration
public Configuration getConfiguration()
getIdentifier
public int getIdentifier(String name,
String defType,
String defPackage)
getResourceName
public String getResourceName(int resid)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getResourcePackageName
public String getResourcePackageName(int resid)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getResourceTypeName
public String getResourceTypeName(int resid)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
getResourceEntryName
public String getResourceEntryName(int resid)
throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
parseBundleExtras
public void parseBundleExtras(XmlResourceParser parser,
Bundle outBundle)
throws org.xmlpull.v1.XmlPullParserException,
IOException
- Throws:
org.xmlpull.v1.XmlPullParserException
IOException
parseBundleExtra
public void parseBundleExtra(String tagName,
AttributeSet attrs,
Bundle outBundle)
throws org.xmlpull.v1.XmlPullParserException
- Throws:
org.xmlpull.v1.XmlPullParserException
getAssets
public final AssetManager getAssets()
flushLayoutCache
public final void flushLayoutCache()
finishPreloading
public final void finishPreloading()
Copyright © 2008-2012. All Rights Reserved.