Skip to content Skip to sidebar Skip to footer

Skia Decoder->decode Returned False When Download Image And Display In Imageview

i have a php page which return image from php page in json format $result = mysql_query('SELECT image FROM image_table WHERE email_id = '$email''); if (!empty($result)) { if

Solution 1:

Try this,

String strPicture;
for (int i = 0; i < address.length(); i++) {
 JSONObject c = address.getJSONObject(i);
 strPicture= c.getString(TAG_IMAGE);
 byte bytePic[] = null;
        try {
            bytePic = Base64.decode(strPicture, Base64.DEFAULT);
        } catch (Exception e) {
            e.printStackTrace();
        }

        if (bytePic != null) {
            ByteArrayInputStream imageStream = new ByteArrayInputStream(
                    bytePic);
            Bitmap theImage = BitmapFactory.decodeStream(imageStream);
            imageStream.reset();
            imageView.setImageBitmap(theImage); //Setting image to the image view
        }
}

Post a Comment for "Skia Decoder->decode Returned False When Download Image And Display In Imageview"