polo777 wrote:
> Re,
> 
> Actually, I still have a problem.
> When I use this trick, the javascript containing in my page doesn't
> work whereas the same page(html/javascript) works when I load it from
> the network or from a file:///android_asset/myfile.html.
> 
> Anything?

Your simple options are:

1. Instead of your fake base URL, use a real network URL pointing to the 
spot where the Javascript, images, and other stuff lives. Of course, 
this will require a network connection to work. You may wish to also 
supply your WebView with a WebViewClient implementation, so you can hook 
shouldOverrideUrlLoading() to determine if a given clicked-upon link 
should go to the Internet or should be loaded from your 
locally-generated content.

2. Don't use WebView for locally-generated material.

Your more complicated options include building a ContentProvider for 
serving your HTML, Javascript, and whatnot, and using the appropriate 
content: URL to load it.

In general, Android makes it rather difficult for one to support 
locally-hosted Web content.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~---------~--~----~------------~-------~--~----~
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