I am selecting an image using Jsoup parser
Elements images = document.select("img");
String src = images.attr("src");
then using this code to get rid off data:image/jpg;base64
pureImageSrc = imageSrc.substring(imageSrc.indexOf(",") + 1);
Now I have correct base 64 string (i guess) which starts and ends like
/9j/4AAQSkZJRgABAQEASABIAAD/4Vl6RXhpZgAAT...............lbRIluL+9/56L+VFOoqhH/2Q==
finally, I am decoding it and setting inside an image view
byte[] decodedString = Base64.decode(pureImageSrc, Base64.URL_SAFE);
Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
imageView.setImageBitmap(decodedByte);
But getting this exception: java.lang.IllegalArgumentException: bad base-64
What's missing in this?