Skip to content

Instantly share code, notes, and snippets.

@WrathChaos
Last active August 14, 2020 10:19
Show Gist options
  • Save WrathChaos/80cd7e613cd7577dae9326e3cd75e4be to your computer and use it in GitHub Desktop.
Save WrathChaos/80cd7e613cd7577dae9326e3cd75e4be to your computer and use it in GitHub Desktop.
String base64String = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAA...";
String base64Image = base64String.split(",")[1];

byte[] decodedString = Base64.decode(base64Image, Base64.DEFAULT);
Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);

imageView.setImageBitmap(decodedByte);
@jackaru
Copy link

jackaru commented Jan 27, 2020

Thanks! 👍

@bhavin1994
Copy link

Back-end (JVM) Internal error: wrong bytecode generated for static initializer base64 coverter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment