whey i wrote below code, the url is opening in the default browser, why its not loading in the my app.
setContentView(R.layout.activity_main);
myWebView = (WebView) findViewById(R.id.webView);
myWebView.loadUrl("http://www.google.com");
whey i wrote below code, the url is opening in the default browser, why its not loading in the my app.
setContentView(R.layout.activity_main);
myWebView = (WebView) findViewById(R.id.webView);
myWebView.loadUrl("http://www.google.com");
Try setting a
WebViewClient
on theWebView
:Maybe you want this solution:
Don't forget to add permission:
Also check this link: https://stackoverflow.com/a/7306176