1

img タグを含む html-content 文字列があります。私が使用する画像のURLを持つために:

Spanned htmlSpan = Html.fromHtml(item.message, imgGetter, null);
descriptionView.setText(htmlSpan);

Html.ImageGetter は、DrawablegetDrawableオブジェクトを返すメソッドを実装する必要があります

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
    }
};

私は助けが必要です。これを整理する方法は?

UPD: aq はaq = new AQuery(this); https://code.google.com/p/android-query/wiki/AsyncAPIです

4

2 に答える 2

0

すべてのイメージ ダウンロードにユニバーサル イメージ ローダーを使用する

于 2014-01-15T17:39:08.400 に答える