0

I've a problem with a simple Android application that have WebView inside and a URL to open. When I try to lanch a App, the URL is opened to Chrome Web Browser, but not in a app. This is a code snippet in main activity:

webView = (WebView) findViewById(R.id.webView1);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://www.example.org");

I've following a official guide and more guide searched, but with the same results.

Resolved with this code:

private class MyWebViewClient extends WebViewClient {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        view.loadUrl(url);
        return true;
    }
}
robdev
  • 1
  • 2

0 Answers0