Ryan wrote:
> Actually, I think I am confusing the issue. I just tried the following
> code inside my WebView:-
> 
> final String mimeType = "text/html";
> final String encoding = "utf-8";
> html = "<BR><B>Tonight's weather in London</B><BR>A few evening
> showers Min 6C(43F )<BR>Probability of rain: 89%<BR>Minimum
> Temperature: 6C(43F )<BR>Wind force Beaufort: 4<BR>Wind description:
> Moderate Breeze<BR>Wind direction: SSW<BR>Sunset at: 4:17 pm";
> this.loadData(html, mimeType, encoding);
> 
> 
> This does not do wha I expect. This displays a WebView with the
> following error message:-
> 
> Web page not available
> The Web page at data:text/html;utf-8...
> might be temporarily down..
> 
> I was expecting the WebView to use my string as the HTML content. This
> is how it works for simpler strings.

Try loadDataWithBaseURL(), even if you have to supply a garbage URL as
the base (e.g., fake://oh.this.is.so.not.real).

Also, try "UTF-8" instead of "utf-8".

Also also, the html variable is a String, and not something else, right?

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Published!

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

Reply via email to