本文整理匯總了Java中android.content.res.Resources.NotFoundException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java NotFoundException.printStackTrace方法的具體用法?Java NotFoundException.printStackTrace怎麽用?Java NotFoundException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.content.res.Resources.NotFoundException
的用法示例。
在下文中一共展示了NotFoundException.printStackTrace方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getColor
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
public int getColor(int resId){
int originColor = context.getResources().getColor(resId);
if(mResources == null || isDefaultSkin){
return originColor;
}
String resName = context.getResources().getResourceEntryName(resId);
int trueResId = mResources.getIdentifier(resName, "color", skinPackageName);
int trueColor = 0;
try{
trueColor = mResources.getColor(trueResId);
}catch(NotFoundException e){
e.printStackTrace();
trueColor = originColor;
}
return trueColor;
}
示例2: getColor
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
public int getColor(int resId) {
int originColor = context.getResources().getColor(resId);
if (mResources == null || isDefaultSkin) {
return originColor;
}
String resName = context.getResources().getResourceEntryName(resId);
int trueResId = mResources.getIdentifier(resName, "color", skinPackageName);
int trueColor = 0;
try {
trueColor = mResources.getColor(trueResId);
} catch (NotFoundException e) {
e.printStackTrace();
trueColor = originColor;
}
return trueColor;
}
示例3: getDrawable
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
@SuppressLint("NewApi")
public Drawable getDrawable(int resId) {
Drawable originDrawable = context.getResources().getDrawable(resId);
if (mResources == null || isDefaultSkin) {
return originDrawable;
}
String resName = context.getResources().getResourceEntryName(resId);
int trueResId = mResources.getIdentifier(resName, "drawable", skinPackageName);
Drawable trueDrawable = null;
try {
if (android.os.Build.VERSION.SDK_INT < 22) {
trueDrawable = mResources.getDrawable(trueResId);
} else {
trueDrawable = mResources.getDrawable(trueResId, null);
}
} catch (NotFoundException e) {
e.printStackTrace();
trueDrawable = originDrawable;
}
return trueDrawable;
}
示例4: readDrawable
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
public static BitmapDrawable readDrawable(Resources res, int resId, Config bitmapConfig) {
BitmapDrawable drawable = null;
Bitmap bitmap = null;
BitmapFactory.Options opts = new BitmapFactory.Options();
opts.inPreferredConfig = Config.RGB_565;
if (bitmapConfig != null) {
opts.inPreferredConfig = bitmapConfig;
}
opts.inPurgeable = true;
opts.inInputShareable = true;
try {
InputStream ips = res.openRawResource(resId);
if (ips != null) {
bitmap = BitmapFactory.decodeStream(ips, null, opts);
}
if (bitmap != null) {
drawable = new BitmapDrawable(res, bitmap);
}
} catch (NotFoundException e) {
e.printStackTrace();
}
return drawable;
}
示例5: getDisplayMetrics
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
public DisplayMetrics getDisplayMetrics() {
// try {
// return mFirst.getDisplayMetrics();
// } catch (NotFoundException e) {
// if (DEBUG) {
// e.printStackTrace();
// }
// }
// return mSecond.getDisplayMetrics();
try {
return mSecond.getDisplayMetrics();
} catch (NotFoundException e) {
if (DEBUG) {
e.printStackTrace();
}
}
throw new RuntimeException("error in getDisplayMetrics().");
// return mSecond.getDisplayMetrics();
}
示例6: openRawResource
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
public InputStream openRawResource(int id, TypedValue value)
throws NotFoundException {
try {
return mFirst.openRawResource(id, value);
} catch (NotFoundException e) {
if (DEBUG) {
e.printStackTrace();
}
}
return mSecond.openRawResource(id, value);
}
示例7: getInteger
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
public int getInteger(int id) throws NotFoundException {
try {
return mFirst.getInteger(id);
} catch (NotFoundException e) {
if (DEBUG) {
e.printStackTrace();
}
}
return mSecond.getInteger(id);
}
示例8: obtainAttributes
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
try {
return mFirst.obtainAttributes(set, attrs);
} catch (NotFoundException e) {
if (DEBUG) {
e.printStackTrace();
}
}
return mSecond.obtainAttributes(set, attrs);
}
示例9: getQuantityText
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
public CharSequence getQuantityText(int id, int quantity)
throws NotFoundException {
try {
return mFirst.getQuantityText(id, quantity);
} catch (NotFoundException e) {
if (DEBUG) {
e.printStackTrace();
}
}
return mSecond.getQuantityText(id, quantity);
}
示例10: getDrawable
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
@Override
public Drawable getDrawable(int id, Theme theme) throws NotFoundException {
try {
return mFirst.getDrawable(id, theme);
} catch (NotFoundException e) {
if (DEBUG) {
e.printStackTrace();
}
}
return mSecond.getDrawable(id, theme);
}
示例11: getColor
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
public int getColor(int id) throws NotFoundException {
try {
return mFirst.getColor(id);
} catch (NotFoundException e) {
if (DEBUG) {
e.printStackTrace();
}
}
return mSecond.getColor(id);
}
示例12: getQuantityString
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
public String getQuantityString(int id, int quantity)
throws NotFoundException {
try {
return mFirst.getQuantityString(id, quantity);
} catch (NotFoundException e) {
if (DEBUG) {
e.printStackTrace();
}
}
return mSecond.getQuantityString(id, quantity);
}
示例13: getText
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
public CharSequence getText(int id, CharSequence def) {
try {
return mFirst.getText(id, def);
} catch (NotFoundException e) {
if (DEBUG) {
e.printStackTrace();
}
}
return mSecond.getText(id, def);
}
示例14: getIdentifier
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
public int getIdentifier(String name, String defType, String defPackage) {
try {
return mFirst.getIdentifier(name, defType, defPackage);
} catch (NotFoundException e) {
if (DEBUG) {
e.printStackTrace();
}
}
return mSecond.getIdentifier(name, defType, defPackage);
}
示例15: getConfiguration
import android.content.res.Resources.NotFoundException; //導入方法依賴的package包/類
public Configuration getConfiguration() {
try {
return mFirst.getConfiguration();
} catch (NotFoundException e) {
if (DEBUG) {
e.printStackTrace();
}
}
return mSecond.getConfiguration();
}