Im new to droid programming and i got a simple retrieve image from url working but confused on how to make it so i can load multiple images from my webpages url. Someone informed me change the drawable to string but not sure 100% how to do so here is most of my code so far:
public class Gallery extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageView imgView =(ImageView)findViewById(R.id.ImageView01);
Drawable drawable = LoadImageFromWebOperations("http://www.mandarichmodels.com/hot-pics/4.jpg", "http://www.mandarichmodels.com/hot-pics/5.jpg");
imgView.setImageDrawable(drawable);
}
private Drawable LoadImageFromWebOperations(String url, String string) {
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;
}
}
}