2013-03-23 68 views
1

在我的应用程序中通过JSON设置web url的布局背景。但在图像视图中我设置为这样如何在Android中通过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(); 
       } 

不作为背景设置。我如何设置布局的背景?

回答