当前位置: 首页>>代码示例>>Java>>正文


Java NotFoundException.printStackTrace方法代码示例

本文整理汇总了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;
}
 
开发者ID:stven0king,项目名称:Android-Skin-Loader,代码行数:21,代码来源:SkinManager.java

示例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;
}
 
开发者ID:imesong,项目名称:themePlugin,代码行数:21,代码来源:SkinManager.java

示例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;
}
 
开发者ID:imesong,项目名称:themePlugin,代码行数:23,代码来源:SkinManager.java

示例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;
}
 
开发者ID:yuhuayi,项目名称:HexExamples,代码行数:25,代码来源:ImageUtils.java

示例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();
	}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:21,代码来源:ResourcesMerger.java

示例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);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:13,代码来源:ResourcesMerger.java

示例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);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:12,代码来源:ResourcesMerger.java

示例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);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:12,代码来源:ResourcesMerger.java

示例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);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:12,代码来源:ResourcesMerger.java

示例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);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:13,代码来源:ResourcesMerger.java

示例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);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:12,代码来源:ResourcesMerger.java

示例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);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:13,代码来源:ResourcesMerger.java

示例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);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:12,代码来源:ResourcesMerger.java

示例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);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:12,代码来源:ResourcesMerger.java

示例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();
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:12,代码来源:ResourcesMerger.java


注:本文中的android.content.res.Resources.NotFoundException.printStackTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。