Hi stackoverflow team i have a problem in converting base64 string to bitmap in android. I am using the camera to fetch the image and i am convert the image to base64 string
EDIT: Accepted post has now been updated to copy my answer below, either are correct
The accepted answer is not correct at least in JellyBean, KitKat or Lollipop. You should use the following which works for JPEG, PNG or GIF images.
byte[] imageAsBytes = Base64.decode(myImageData.getBytes(), Base64.DEFAULT);
ImageView image = (ImageView)this.findViewById(R.id.ImageView);
image.setImageBitmap(
BitmapFactory.decodeByteArray(imageAsBytes, 0, imageAsBytes.length)
);