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

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

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

c# - Populating Gridview inside Listview ItemTemplate On Web User Control from Code Behind -