How to save an image in the bank

Asked

Viewed 611 times

2

I want to take the image of imageView save in the bank and make the last saved image back when open the app

code to transform the image in byte

    ByteArrayOutputStream saida = new ByteArrayOutputStream();
    bitmap.compress(Bitmap.CompressFormat.PNG,100,saida);
    imagem = saida.toByteArray();

byte for bitmap

    bitmap = BitmapFactory.decodeByteArray(imagem, 0, imagem.length);
    imageView.setImageBitmap(bitmap);

i made a test with two imageview, I took the image I turn into byte, after byte to image and put in imageview 2, but when I try to do this process by database the image does not appear

  • The recommended is to upload the image to the provider and save the path in the database. So when you need to review the image in the app, just inform the path and redenrize the image. That’s what I do. .. if you want an example....

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.