'Android Studio: Open every URL in WebView

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/");
}


Solution 1:[1]

You can use setWebViewClient()

WebView webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient());
...

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 hata