I have a html-content String with img tags. For having image urls I use:
Spanned htmlSpan = Html.fromHtml(item.message, imgGetter, null);
descriptionView.setText(htmlSpan);
Html.ImageGetter must implement method getDrawable
which should return Drawable object
Html.ImageGetter imgGetter = new Html.ImageGetter() {
public Drawable getDrawable(String source) {
aq.ajax(Cfg.SITE_URL+source, Drawable.class, new AjaxCallback<Drawable> (){
@Override
public void callback(String url, Drawable d, AjaxStatus status) {
//Something here
}
});
return result; // nothing for result now
}
};
I need help. How to organize this?
UPD: aq is aq = new AQuery(this);
https://code.google.com/p/android-query/wiki/AsyncAPI
Use Universal image loader for all image download