开发者

Html.fromHtml problem

开发者 https://www.devze.com 2023-03-29 20:35 出处:网络
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\"

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

精彩评论

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