Android-Bild wurde von Bild-URL nicht in ImageView angezeigt

Ich möchte ImageView ein Bild von "http: //i.imgur.co / 4GLKF4Q.jpg "aber das Bild in der Bild-URL wurde nicht in der Bildansicht angezeigt. Kann ich das tun?

AsyncTask

class DownloadImageTask extends AsyncTask<String, Void, byte[]> {
    ImageView bmImage;

    public DownloadImageTask(ImageView bmImage) {
        this.bmImage = bmImage;
    }

    protected byte[] doInBackground(String... urls) {
        try {
            URL url = new URL(urls[0]);
            InputStream is = (InputStream) url.getContent();
            byte[] buffer = new byte[8192];
            int bytesRead;
            ByteArrayOutputStream output = new ByteArrayOutputStream();
            while ((bytesRead = is.read(buffer)) != -1) {
                output.write(buffer, 0, bytesRead);
            }
            return output.toByteArray();
        } catch (MalformedURLException e) {
            e.printStackTrace();
            return null;
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }

    protected void onPostExecute(byte[] result) {
        ByteArrayInputStream imageStream = new ByteArrayInputStream(result);
        Bitmap bm = BitmapFactory.decodeStream(imageStream);
        bmImage.setImageBitmap(bm);
    }
}

in Aktivität

new DownloadImageTask((ImageView) newView.findViewById(R.id.thumbnail))
            .execute("http://i.imgur.com/4GLKF4Q.jpg");

Das Bild in der Bild-URL wurde in der Bildansicht nicht angezeigt. in Logcat:

09-23 10:26:49.410 10591-10591/com.*** D/skia: --- SkImageDecoder::Factory returned null

Antworten auf die Frage(6)

Ihre Antwort auf die Frage