當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。