Still having problems with this...
So when I try to use the above code on an Item inserted in a ListView
it still does not work. I tried inflating the following code which
did not work.
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/
android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_weight="1"
/>
I then tried wrapping the above in a LinearLayout and that did not
work either... The shouldOverrideUrlLoading is never called.
Any ideas. I assume it is a problem with the ListView but I am not
sure
thanks, Mark
On Feb 2, 2:28 pm, Mark Nuetzmann <[email protected]> wrote:
> Yes. thank you.
>
> For others, here is the code that I am currently using that appears to
> work.
>
> WebView web = (WebView) findViewById(R.id.webview);
>
> web.getSettings().setJavaScriptEnabled(true);
> web.getSettings().setJavaScriptCanOpenWindowsAutomatically
> (false);
> web.getSettings().setPluginsEnabled(false);
> web.getSettings().setSupportMultipleWindows(false);
> web.getSettings().setSupportZoom(false);
> web.setVerticalScrollBarEnabled(false);
> web.setHorizontalScrollBarEnabled(false);
>
> web.loadData( YOUR_URL_DATA, "text/html", "utf-8");
>
> web.setWebViewClient(new WebViewClient() {
> @Override public boolean shouldOverrideUrlLoading
> (WebView view, String url) {
> // return true to handle the click yourself
> return true;
> }
> });
>
> On Feb 2, 1:28 pm, Mark Murphy <[email protected]> wrote:
>
> > Mark Nuetzmann wrote:
> > > I want toextendtheWebViewso that I can override the action of
> > > clicking on a link in thewebview.
>
> > You want to set a WebViewClient on theWebView, where in the
> > WebViewClient you put your logic in shouldOverrideUrlLoading().
>
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > Android Training in Sweden --http://www.sotrium.com/training.php
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---