Problem on loading images from url
<p>i want to load an image from a url.i have 10 images on my server and i m calling one in every class .it works but there are some pictures that are not opening...is there any wrong on my code?i have checked the url and its ok!thanks</p>

<pre><code>public class modern_clock extends Activity{

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);

        setContentView(R.layout.sites); 



        ImageView im = (ImageView) findViewById(R.id.image); 
        Drawable drawable = LoadImageFromWeb("http://kostas-menu.gr/chania/roloi.jpg");
        im.setImageDrawable(drawable);



        TextView title1 = (TextView) findViewById(R.id.text_title);
        title1.setText("The Clock\n" );

    TextView info = (TextView) findViewById(R.id.info);
    info.setText(".................\n" );





    }
     private Drawable LoadImageFromWeb(String url) {
        // TODO Auto-generated method stub
         try{
         InputStream is = (InputStream) new URL(url).getContent();
           Drawable d = Drawable.createFromStream(is, "src name");
           return d;
          }catch (Exception e) {
           System.out.println("Exc="+e);
           return null;
    }
} 


}
</code></pre>

<p>EDIT:</p>

<p>@George:</p>

<p>i have added in my package the LoaderImageView,java class.i also changed my xml file from the simple imageview to</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>and in every class of my project i have added that:</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>but unfortunately with that way i m always getting the image from the url in my xml file.i have the same xml for all my classes,so how could i set the image from the java file?i tried to erase the line image:"http...." from the manifest,but this is not returning any image at all!!thanks</p>
