Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

shouldoverrideurlloading not called Webview Android

First of all , this post may ,look like a Possible Duplicate of other question, but I have go through many questions but found them not helpful. Now My problem is that I am loading an URL in my Webview and then I want to Trace URL on each event on webview so I have set up WebviewClient for Webview and overridden shouldoverrideurlloading method, but after first Event , shouldoverrideurlloading not getting called. (worked first time)

Here is the Code I have used :

    wvSecurity = (WebView) findViewById(R.id.wvSecurity);               
    wvSecurity.getSettings().setJavaScriptEnabled(true);
    wvSecurity.getSettings().setAllowContentAccess(true);
    wvSecurity.getSettings().setAllowUniversalAccessFromFileURLs(true);     
    wvSecurity.getSettings().setBuiltInZoomControls(false);
    wvSecurity.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    wvSecurity.getSettings().setLoadWithOverviewMode(true);
    wvSecurity.getSettings().setDomStorageEnabled(true);

    wvSecurity.loadUrl("URL");

    wvSecurity.setWebViewClient(new WebViewClient() {
                @Override
                public boolean shouldOverrideUrlLoading(WebView view,
                        final String urlStr) {
                    Log.i("URL", "::" + urlStr);
                    return false;
                }
    }

EDIT ::

Ok, The URL which I want to Trace uses POST method , Now my question is How can I trace POST URL and its data. And one thing , I dont have access to Webpage coming in so I simply cant go for GET method. Please Help !!!

like image 290
GOLDEE Avatar asked May 29 '26 08:05

GOLDEE


1 Answers

I guess this method gets called when a hyperlink is tapped from page or some redirection happens. So make sure this thing.

like image 57
Fazal Hussain Avatar answered Jun 01 '26 00:06

Fazal Hussain