如何从Android中的Web视图获取当前页面的URL [英] how to get the current page url from the web view in android

查看:1215
本文介绍了如何从Android中的Web视图获取当前页面的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用webview.loadUrl(url)方法打开一个URL.如果在视图上单击任何Button,它将定向到另一页.现在,我想获取定向页面的URL.我怎么能得到它?

Using webview.loadUrl(url) method I open an url. If I click any Button on the view it directs to another page. Now I want to get the url of the directed page. how can I get it?

我还希望显示在Web视图上的内容.如何获取WebView的内容?

I also want the content that is displayed on the webview. How to get the content of the WebView ?

推荐答案

String webUrl = webView.getUrl();

这篇关于如何从Android中的Web视图获取当前页面的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆