I have a few days with the same problem, I am making an application in which I need to save images in SQLite, until then good. The problem is when trying to recover, attached my code:
recuperarImagen = db.rawQuery("SELECT fotoPerfil FROM perfil WHERE _id = 1", null);
if(recuperarImagen.moveToFirst()){
byte[] blob = recuperarImagen.getBlob(0);
ByteArrayInputStream inputStream = new ByteArrayInputStream(blob);
Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
imagenPersonal.setImageBitmap(bitmap);
}
recuperarImagen is the Cursor
BitmapFactory.decodeStream(inputStream) RETURN NULL
If anyone can help I would be very grateful, Thanks in advance!
Aucun commentaire:
Enregistrer un commentaire