为什么图像背景为紫色

时间:2015-08-14 22:27:24

标签: android image imageview android-imageview

我试图在ImageView中显示this transparent image

我下载并使用此类设置图像:

public class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
    private String TAG = "DownloadImageTask";
    ImageView bmImage;

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

    protected Bitmap doInBackground(String... urls) {
        String urldisplay = urls[0];
        Bitmap mIcon11 = null;
        try {
            InputStream in = new java.net.URL(urldisplay).openStream();
            mIcon11 = BitmapFactory.decodeStream(in);
        } catch (Exception e) {
            Log.d(TAG, e.getMessage());
            e.printStackTrace();
        }
        return mIcon11;
    }

    protected void onPostExecute(Bitmap result) {
        bmImage.setImageBitmap(result);
    }
}

不幸的是背景变紫了。为什么它会变紫?我该如何解决?

0 个答案:

没有答案