Android WebView client shouldOverrideUrlLoading() method is not getting called for redirect urls -


i trying intercept code redirect instagram authentication. i'm using shouldoverrideurlloading() stop page loading, webview goes ahead , loads anyway. here code

            public boolean shouldoverrideurlloading(webview view, webresourcerequest request) {              string url = view.geturl();             if (url.startswith("https://someurl.com")){                 return true;             }             return false;          } 

found out using webview url instead of url webresourcerequest, following code string url = view.geturl(); should string url = string.valueof(request.geturl(); , whole method so:

        public boolean shouldoverrideurlloading(webview view, webresourcerequest request) {          string url = string.valueof(request.geturl();         if (url.startswith("https://someurl.com")){             return true;         }         return false;      } 

Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -