在我的应用程序中,通过JSON从web url设置布局背景。但在图像视图中,我设置如下
try {
ImageView i = (ImageView)findViewById(R.id.animation);
Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL("http://alpharithm.in/manager/test/img/files/products/mushroom-soup.jpg").getContent());
i.setImageBitmap(bitmap);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
不要设置为背景。如何为布局设置背景?