Implement onReceivedError() in your WebViewClient.

On Mon, Feb 14, 2011 at 1:21 PM, Craigbtx <craig...@austin.rr.com> wrote:
> I am using webview. If the page is not correct or the website is down,
> how can I error trap a page not found and show the users an error page
> or some
>
> othe page?
>
> I am very much a beginner so I need examples of code.
>
>
>  @Override
>    public void onCreate(Bundle savedInstanceState) {
>        super.onCreate(savedInstanceState);
>        setContentView(R.layout.main);
>
>        WebView webview = new WebView(this);
>        setContentView(webview);
>
>        WebSettings webSettings = webview.getSettings();
>        webSettings.setJavaScriptEnabled(true);
>        webSettings.setBuiltInZoomControls(true);
>
>        // No error trapping
>        webview.setWebViewClient(new WebViewClient());
>        webview.loadUrl("http://www.MyWebsite.com";);
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to