title: Set the background of a View from a string URL
body: <p>I want to set the background of a view from a string URL. I used this code to set an image from drawable:</p>
  
  <p><a href="http://www.image.com/image.png" rel="nofollow noreferrer">The sample URL</a></p>
  
  <pre><code>View rightv = row.findViewById(R.id.four);
  rightv.setBackgroundResource(R.drawable.demoimage);
  rightv.setTag(position);
  rightv.setOnClickListener(MembersDealActivity_a.this);
  </code></pre>
  
  <p>But when I tried to do the same from the URL, it did not work. I tried this sort of code too, but it did not work either: </p>
  
  <pre><code>Drawable res = getResources().getDrawable(imageResource);
  right.setBackgroundDrawable(res);
  right.setTag(position);
  right.setOnClickListener(MembersDealActivity_a.this);
  </code></pre>
  
  <p>I also have tried to use the Picasso library, but when it request to set a value into parameter view it can't be cast there.</p>
  
  <pre><code>Picasso.with(this)
      .load(imag_link).resize(600, 350)
      .into(imv);
  </code></pre>
  
  <p>The full code:</p>
  
  <pre><code>public class MyActivity extends Activity implements
          AdapterView.OnItemClickListener, View.OnClickListener {
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          ListView list = new ListView(this);
          setContentView(list);
  
          String[] items = { "Tom", "Sally", "Bill", "John", "Santiago",
                  "Isabella" };
  
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,
                  R.layout.review, R.id.textView1, items) {
              @Override
              public View getView(int position, View convertView, ViewGroup parent) {
                  View row = super.getView(position, convertView, parent);
  
  
                  View text = row.findViewById(R.id.seemore);
                  text.setTag(position);
                  text.setOnClickListener(MyActivity.this);
  
  
  
                  View left = row.findViewById(R.id.imageView1);
                  left.setBackgroundResource(R.drawable.newapture);
                  left.setTag(position);
                  left.setOnClickListener(MyActivity.this);
  
  
                  return row;
              }
          };
  </code></pre>