您好我想从我的sqlite数据库获取图像,但我不能。这里是mycodes:
public Bitmap ResmiAl(int dersID){
SQLiteDatabase db = this.getWritableDatabase();
Cursor c = db.rawQuery("select * from fotolar_table",null);
if(c.moveToNext()){
byte [] image = c.getBlob(c.getColumnIndex("foto"));
ByteArrayInputStream inputStream = new ByteArrayInputStream(image);
Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
//Bitmap foto = BitmapFactory.decodeByteArray(image,2,image.length);
return bitmap;
}
else {
return null;
}
}