How to get new URL parameters in a Webview?


I would like to ask how to implement this, i have an application where in if i click a certain button it will access a webview in-app browser, the problem is that from the webview there is a button that, when clicked will redirect into a new page. the question is how am i able to get the URL of that new page? for example. the original URL is and when I clicked the button on the web page it will go to another page how to get the I am able to get easily using onPageFinished. but cant gets the next page. note that I clicked the button on the webpage itself. i used already the shouldOverrideUrlLoading but it doesn’t work. any ideas? a good example will do. thank you!


Check this Out :

WebView webview  new WebView(context);
webview.setWebViewClient(new WebViewClient()
            public void onPageStarted(WebView view, String url, Bitmap favicon) {
                super.onPageStarted(view, url, favicon);

                Log.d("WebView", "your current url when webpage loading.." + url);

            public void onPageFinished(WebView view, String url) {
                Log.d("WebView", "your current url when webpage loading.. finish" + url);
                super.onPageFinished(view, url);

            public void onLoadResource(WebView view, String url) {
                // TODO Auto-generated method stub
                super.onLoadResource(view, url);
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                System.out.println("when you click on any interlink on webview that time you got url :-" + url);
                return super.shouldOverrideUrlLoading(view, url);

Answered By – Muntasir Aonik

Leave a Comment