title: How do i set relative layout background image from URL using Volley or something else?
body: <p>I want to set layout background image from web URL, </p>
  
  <p>either using volley or Picasso or some else </p>
  
  <p>is there any way to set this! </p>
  
  <p>I found below code this from web but not working !!</p>
  
  <pre><code>Bitmap myImage = getBitmapFromURL("http://looksok.files.wordpress.com/2011/12/me.jpg");
  RelativeLayout rLayout=(RelativeLayout)findViewById(R.id.relativeLayout);
  
  //BitmapDrawable(obj) convert Bitmap object into drawable object.
  Drawable dr = new BitmapDrawable(myImage);
  rLayout.setBackgroundDrawable(dr);
  
  public Bitmap getBitmapFromURL(String imageUrl) {
      try {
          URL url = new URL(imageUrl);
          HttpURLConnection connection = (HttpURLConnection) url.openConnection();
          connection.setDoInput(true);
          connection.connect();
          InputStream input = connection.getInputStream();
          Bitmap myBitmap = BitmapFactory.decodeStream(input);
          return myBitmap;
      } catch (IOException e) {
          e.printStackTrace();
          return null;
      }
  }
  </code></pre>