I have the following code to get URL from HTML file using jsoup and save in array:
Element table2 = document.select("TABLE").get(1);
for (Element td : tr.select("td")){
Element img = td.select("img").first();
if (img == null){
continue;
}
String imgRelPath = img.attr("src");
images.add("http://hostname.com"+imgRelPath);
}
}
objImages = images.toArray();
The array has:
http://hostname.com/hobbit/gifs/static/green.gif
http://hostname.com/hobbit/gifs/static/green.gif
http://hostname.com/hobbit/gifs/static/clear.gif
http://hostname.com/hobbit/gifs/static/clear.gif
http://hostname.com/hobbit/gifs/static/green.gif
http://hostname.com/hobbit/gifs/static/red.gif
http://hostname.com/hobbit/gifs/static/green.gif
http://hostname.com/hobbit/gifs/static/green.gif
http://hostname.com/hobbit/gifs/static/green.gif
http://hostname.com/hobbit/gifs/static/green.gif
No I need get all images from url and put into imageView one after the other. Any idea?
Thanks in advance.
EDIT:
I'm calling Picasso.with in Async Task on onPostExecute in MainActivity:
@Override
protected void onPostExecute(Void result) {
ImageView estados = (ImageView) findViewById(R.id.estados);
Picasso.with(MainActivity.this).load("http://salesianoscarmona.com/nuevo/templates/rt_modulus_j15/images/icons/icon-crank.png").into(estados);
mProgressDialog.dismiss();
}
I have the import in the header:
import com.squareup.picasso.Picasso;