I want to turn a website into an app using the WebView. However, if I tap a link in the WebView, the app does not try to load the URL in the WebView, but in the browser (Chrome). How can I change this?
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView webView = (WebView) findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("https://100315.fuxnoten.online/webinfo/account/");
}
CodePudding user response:
You can use setWebViewClient()
WebView webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient());
...