Wednesday, August 24, 2011

[android-developers] Re: image won't show

On Aug 24, 10:40 pm, bob <b...@coolgroups.com> wrote:
> Hmm... That worked, but I need HTML mixed with the image.  Do you know
> how to do that?
>
> On Aug 24, 1:49 am, Jeremy Dagorn <jeremy.dag...@gmail.com> wrote:
>
>
>
> > Hi,
>
> > Why you don't do something like that :
>
> > String imageUrl = "file:///android_asset/smiley.png";
> > WebView wv = new WebView(this); // or findViewById in your case
> > wv.loadUrl(imageUrl);
>
> > On Aug 23, 9:49 pm, bob <b...@coolgroups.com> wrote:
>
> > >                 Anyone know why this image won't show?
>
> > > WebView wv = (WebView) findViewById(R.id.widget30);
> > > String html = "<html><body><img src=\"file:///android_asset/smiley.png
> > > \"></body></html>";
> > > wv.loadData(html, "text/html", "utf-8");

If you need just a simple image and some text around you can use
TextView and its setSpan method

pskink

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment