i m chargement des images de description rss utilisantUtilisez AsyncTask pour charger des images
String description2 = des.get(position).toString();
Spanned description = Html.fromHtml(description2, new ImageGetter() {
@Override
public Drawable getDrawable(String source) {
Drawable d = null;
try {
InputStream src = imageFetch(source);
d = Drawable.createFromStream(src, "src");
if(d != null){
d.setBounds(0,0,d.getIntrinsicWidth(),
d.getIntrinsicHeight());
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return d;
}
public InputStream imageFetch(String source)
throws MalformedURLException,IOException {
URL url = new URL(source);
Object o = url.getContent();
InputStream content = (InputStream)o;
// add delay here (see comment at the end)
return content;
}
},null);
Comment puis-je les mettre dans un AsyncTask, afin d'obtenir une barre de progression jusqu'à ce que les images télécharger? Merci!
Regardez [Android HTML ImageGetter comme AsyncTask] (http://stackoverflow.com/questions/7424512/android-html-imagegetter-as-asynctask) – user370305