SOLVED
Ok i got it to work first go..took me longer to write this post, lucky
guess!
Don't know how i did it- i'm an old procedural programmer...don't know
java or OO
you guys don't know how easy programming used to be..!
i digress, ok you replace the WebViewClient with you own
class, MyWebViewClient intercept the error before it happens..
hope it helps...
i tested this on android 1.5!
private class MyWebViewClient extends WebViewClient {
@Override
public void onReceivedError(WebView view, int errorCode, String
description, String failingUrl) {
//do something on error
//view.loadUrl("file:///android_asset/
index.htm");
view.loadData("Your internet
connection may be
down? Please restart your app.", "text/html", "UTF-8");
}
}
// normal OO malarky
myWebView = (WebView) findViewById(R.id.webview);
myWebView.setWebViewClient(new MyWebViewClient());// magic
here
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);//enable java script
myWebView.loadUrl("file:///android_asset/
page_dosent_exist.htm");// url non sense
--
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