简体   繁体   中英

How to get current url from webview?

I am developing an android application in which I am using Webview object. I am sending an url and couple parameters to Webview object. Please check below line.

String url = "www.myurl.com";
webView.postUrl(url,EncodingUtils.getBytes(postStr, "utf-8"));

For now, I can see my url in webview . This url has couple submission functionality, At the end of scenario, it sends me to success url. But I am not getting that url pro-grammatically. I have used To get that url using below function of webview.

@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
    view.loadUrl(url);
} 

It's working for earlier urls but its not getting for final url .

How to do that?

@SagarP is correct. webView.getUrl() will return the URL according to the WebView Documentation

webView.loadUrl("THE URL");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM