/** * 构造方法创建数据库,并取得SQLiteDatabase对象 * * @param */ private SQLiteHelper() { super( BaseApplication.getInstance().getApplicationContext(), dbArchitecture.getDBName(), null, dbArchitecture.getCurrentVersion()); // this.getWritableDatabase(); }
/** * 把图片资源文件转换为Bitmap * * @param resId :图片资源文件编号 * @return */ public static Bitmap readBitMap(int resId) { BitmapFactory.Options opt = new BitmapFactory.Options(); opt.inPreferredConfig = Bitmap.Config.RGB_565; opt.inPurgeable = true; opt.inInputShareable = true; // opt.inJustDecodeBounds = false; // opt.inSampleSize = 50; // 獲取資源圖片 InputStream is = BaseApplication.getInstance().getApplicationContext().getResources().openRawResource(resId); return BitmapFactory.decodeStream(is, null, opt); }