android - Visualizing an image from Html.fromHtml in a TextView(The image must be in the server) -
this question has answer here:
i have problem. i'm trying show image in textview
in android studio method html.fromhtml
, problem image in server, how can this? there code:
textview1.settext(html.fromhtml(s), textview.buffertype.spannable); textview1.setmovementmethod(linkmovementmethod.getinstance());
ps: image in server because use httpurlconnection
html text internet
the method html.fromhtml
supports loading of <img>
tags, you're going need manage way images fetched yourself.
remember, not web client... android app. fromhtml
method method interprets html tags, , creates appropriate spannables
best fit html tags.
and so, we're the issue images (img
tags). again, not web client. you're going need load images yourself.
to this, need pass fromhtml
method imagegetter
implementing class. see example how implement imagegetter
here.
short version - you'll need implement method accepts string of asset name, , returns drawable
object. method needs synchronous, means you're going need pre-load image files server before-hand , have them ready load when call fromhtml
.
Comments
Post a Comment