开发者

Html.fromHtml problem

I'm using Html.fromhtml to insert image in an editText ... but the instead of displaying the image, it displays [obj] " the text obj inside a square" what could be the problem ?? This is the imageGetter

ImageGetter imageGetter = new ImageGetter() {
public Drawable getDrawable(String source) {
Drawable d = getResources().getDrawable(R.drawable.e11);
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
 return d;
             }
          };

This is the code lin开发者_Go百科e:

CharSequence cs = 
Html.fromHtml("<img src='" +getResources().getDrawable(R.drawable.e11)+ "'/>"
,imageGetter, null);


A better way to do this would be to add a WebView.


Your imageGetter instance is not doing the correct thing. Where is it trying to retrieve the images from and what does it look like?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜