1

在我的应用程序中通过 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();
                }

不要设置为背景。如何为布局设置背景?

4

1 回答 1

1

您可以从这里获得参考。

设置线性布局背景

希望这对您有所帮助。

于 2013-03-23T11:10:33.847 回答