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

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -