I found the ultimate work-around. After the page is loaded, iterate
through all links, and manually fix the ones that are problematic:

function markup_links() {
    for (var i=0; i < document.links.length; i++) {
        var li = document.links[i];
        if (li.href == ......) {
            /* fix the li's style to an inactive link */
        }
    }
}

I just run this code at the end of the data to be loaded into WebView.

On Sep 20, 11:39 pm, "[email protected]"
<[email protected]> wrote:
> My work-around works for all cases except one: if the page contains
> this link:
>
> <a href="">click</a>
>
> When the user clicks the link, shouldOverrideUrlLloading is not
> called.
>
> On Sep 18, 5:15 pm, Jason Proctor <[email protected]>
> wrote:
>
> > you probably want to set the web view client before calling any
> > variant of load().
>
> > there are some strange things associated with loadDataWithBaseURL()
> > and base URLs, search the archives. sometimes the WebView loads the
> > base URL instead of the provided data, i've never really got to the
> > bottom of it.
>
> > another thing you are probably running into is that
> > shouldOverrideUrlLoading() is not called on reloading the same page.
> > that's a nasty bug that's caused me some trouble. sounds like you can
> > work around it by faking a parameter, but that didn't work for me in
> > my case.
>
> > hth
>
> > >Has anyone seen this?
>
> > >webView.loadDataWithBaseURL("http://www.google.com";,
> > >"<a href=http://www.google.com>click</a>", "text/html", "utf-8", nul);
> > >webView.setWebViewClient(new WebViewClient() {
> > >     public boolean shouldOverrideUrlLloading(WebView w, String url) {
> > >         System.out.println(url);
> > >         return true;
> > >     }
> > >});
>
> > >When user clicks the link, my shouldOverrideUrlLloading() function is
> > >not called. Instead, the WebView just goes out to fetch the real
> > >www.google.compage.
>
> > >For the time being, my work-around is to append "?foo=bar" into the
> > >baseURL.
>
> > >Is there a better work around?
>
> > >Thanks
>
> > --
> > jason.vp.engineering.particle- Hide quoted text -
>
> > - Show quoted text -
>
>
--~--~---------~--~----~------------~-------~--~----~
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