Edit: When I save those bytes in the txt file and when I save it as png file , it shows the image, but it is not working here why...?
I am using this code to create
remove the below line from your code and try again
base64data=base64data.substring(1,base64data.length()-1);
Try this code while getting bitmap from different resources...
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeByteArray(base64converted,0,base64converted.length,options);
// Calculate inSampleSize
options.inSampleSize = calculateInSampleSize(options, 500, 500);
// Decode bitmap with inSampleSize set
options.inJustDecodeBounds = false;
Bitmap bmp1=BitmapFactory.decodeByteArray(base64converted,0,base64converted.length,options);
follow the tutorial on this link Efficient way to show bitmaps