Load images from URL
<p>I am trying to load some images in my app according to the following tutorial: </p>

<p><a href="http://www.anddev.org/novice-tutorials-f8/imageview-with-loading-spinner-t49439.html" rel="nofollow">http://www.anddev.org/novice-tutorials-f8/imageview-with-loading-spinner-t49439.html</a></p>

<p>My problem is that I would like to have the same XML file for all my classes and just change the URL of the load image.</p>

<p>I'm using this code in my <code>.java</code> file:</p>

<pre><code>final LoaderImageView image = new LoaderImageView(this, 
                                          "http://kostas-menu.gr/chania/santrivani.jpg");
image.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, 
                                       LayoutParams.WRAP_CONTENT));
</code></pre>

<p>And this in my xml:</p>

<pre><code>&lt;com.example.android.LoaderImageView
   android:layout_marginTop="10px"
   android:id="@+id/loaderImageView"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_gravity="center"
   android:gravity="center"
   image="http://developer.android.com/images/dialog_buttons.png"
   /&gt;
</code></pre>

<p>I would like to erase the line <code>image="http://developer.android.com/images/dialog_buttons.png"</code>but if I do it I'm not getting any image. </p>

<p>How could I call a separate image from my class?</p>
