我试图从数据库加载图像,但图像没有加载,logcat 显示 null 是不是 simethinf 与我编程的方式..
imgdisplay = (ImageView) findViewById(R.id.imgIcon);
myDB = this.openOrCreateDatabase("hello", MODE_PRIVATE, null);
Cursor c = myDB.rawQuery(
"SELECT image FROM employee_details WHERE name= 'vv'", null);
if (c.getCount() > 0) {
c.moveToFirst();
do {
byte[] blob = c.getBlob(c.getColumnIndex("image"));
ImageView iv = (ImageView) findViewById(R.id.imgIcon);
iv.setImageBitmap(BitmapFactory.decodeByteArray(blob, 0,blob.length));
} while (c.moveToNext());
}
c.close();
myDB.close();
Logcat 错误是...
08-02 04:51:25.471: D/skia(8433): --- SkImageDecoder::Factory returned null