[android-developers] Re: Call a WebView javascript function from the activity?

2011-04-01 Thread Maps.Huge.Info (Maps API Guru)
You have most of it. Just add a call to the JavaScript function from your code like this: mWebView.loadUrl(javascript:bookBtn();) ; That will fire the function just like if you did it in the address bar of a browser. Mark Murphy has this method documented in one of his books (http://

[android-developers] Re: Call a WebView javascript function from the activity?

2011-04-01 Thread Streets Of Boston
First, have you tried javascript:loadTOC*()* instead of javascript:loadTOC. You forgot the open and close braces. Secondly, i'm not sure what your script does. You want to execute an anonymous function when your document finished loading. This anonymous function just declares another function

[android-developers] Re: Call a WebView javascript function from the activity?

2011-04-01 Thread Maps.Huge.Info (Maps API Guru)
If you're having trouble debugging the JavaScript and HTML portion of your webview, you can always load that portion in a browser and use the standard debugging tools it provides to reveal errors. The debugging capabilities of webview are pretty limited. Do check your logs for JavaScript errors

[android-developers] Re: Call a WebView javascript function from the activity?

2011-04-01 Thread camelCaser
Thnx!! That was too easy. I added the brackets then moved the function to the body and now it sees (fires) the function. Thanx for the help!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to