When I execute bitmap.getHeight(); I got a nullPointerException. This is how I try to get my bitmap:
In my json:"pic":"iVBORw0KGgoAAAANSUhEUgAAAgAAAAGACAIAAABUQk3......."
I retrieve from json the following:
byte[] decode = Base64.decode(jsonObj.getString("pic"), Base64.DEFAULT);
Log.i("size",decode.length+""); //65535
Bitmap pic = getImage(decode);
public static Bitmap getImage(byte[] image) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
return BitmapFactory.decodeByteArray(image, 0, image.length,options);
}
But I can't display the image. Any ideas?