After reading this post, I thought it would be plain sailing adding a WebView
of one of my web pages. But how wrong i was, I can only assume the problem is due to scripting, but here is my code
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout);
WebView mv = (WebView)findViewById(R.id.webView);
mv.getSettings().setJavaScriptEnabled(true);
final Activity activity = this;
mv.setWebViewClient(new WebViewClient() {
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Toast.makeText(activity, description + " (" + errorCode + ") " + failingUrl, Toast.LENGTH_SHORT).show();
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Toast.makeText(activity, url, Toast.LENGTH_SHORT).show();
view.loadUrl(url);
return true;
}
});
mv.loadUrl("http://www.google.co.uk");
}
The code builds and runs, but the web page does not load i get an error code of -1 back and see the below line the logcat.
01-11 14:46:55.362: D/chromium(22438): Unknown chromium error: -400
I have internet permission as another part of my application uses adverts and they are fine.