本文整理汇总了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();
}