title: Associate an image with Radio button in Android
body: <p>I want to fetch Images from my URL and add it to the radio button that is further added to a radio group. However, i could not find metod such as setText to set text for radio button. I wish to add image to my radio button in similar fashion. Is there any hint/method that can do the same for me? Any hint/code example would be really helpful for me,</p>
  
  <pre><code>        RadioGroup rg = new RadioGroup (this); 
              rg = (RadioGroup) findViewById(R.id.radioGroup1);
              RadioButton rb[]= new RadioButton[children.size()];
  
              for (int i = 0; i &lt; var.size(); i++) 
                  {   
                  Element movieAtt = (Element)doc.getRootElement().getChild("movies").getChildren("movie").get(i);                                            
                  MovieName[i]=movieAtt.getAttributeValue( "Title" );
                  MovieCover[i]=movieAtt.getAttributeValue( "cover" );
                  ShowTime[i]=movieAtt.getAttributeValue( "showtime" );
  
                  rb[i] = new RadioButton(this);
                  rb[i].setText(movieAtt.getAttributeValue("Title"));
                  rg.addView(rb[i]);  
  
                  //Calling this func to get Images
                  //LoadImageFromWebOperations(movieAtt.getAttributeValue( "cover" ));
                  //rb[i].buildDrawingCache(LoadImageFromWebOperations(movieAtt.getAttributeValue( "cover" )));
  
  
  
  public static Drawable LoadImageFromWebOperations(String url) 
  {
          try 
          {
              InputStream is = (InputStream) new URL(url).getContent();
              Drawable d = Drawable.createFromStream(is, "src name");
              return d;
          } 
          catch (Exception e) 
          {
              return null;
          }
  }
  </code></pre>