Hmm... yes, that's odd. It's been a while, but iirc not putting it in
onLoadResource() in 1.0 was giving
me trouble. I'm pretty sure I went to the trouble after some googling.

When I put before the loadURL (), it now works again. That's pretty
bizarre behavior though. I can
see not loading the object at all (ie window.phz == null) but loading
an object with no methods
is just plain weird.

Mike

On Jun 4, 4:23 pm, Mark Murphy <[email protected]> wrote:
> Michael Thomas wrote:
> > Hi all,
>
> > I just got my 1.5 pushed to me yesterday and it seems that
> > WebView.addJavascriptInterface stopped
> > working.
>
> Visit:
>
> http://commonsware.com/AdvAndroid
>
> where you will find source code to one of my books. In that ZIP file,
> you will find a couple of WebKit projects, both of which use
> addJavascriptInterface(), and both of which work fine on Android 1.5.
>
> > What I have is:
>
> >        public class phzJSI {
> >            public void backbutton () {
> >                    mHandler.post(new Runnable () {
> >                            public void run () {
> >                                    setMain (null);
> >                            }
> >                    });
> >            }
>
> >        private class phzWVC extends WebViewClient {
> >            public void onLoadResource (WebView w, String url) {
> >                    w.addJavascriptInterface(new phzJSI (), "phz");
> >                 }
>
> Why are you calling addJavascriptInterface() in onLoadResource()? Why
> not before you load the page?
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android App Developer Books:http://commonsware.com/books.html
--~--~---------~--~----~------------~-------~--~----~
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