Android的检测网页流量URL变化流量、网页、Android、URL

2023-09-07 09:05:25 作者:杀死所有喜欢

我在我的Andr​​oid应用程序网页视图,并想检测什么时候去URL变化。

I have a webview in my android app and would like to detect when de url changes.

我想用这个隐藏在最上面一栏的信息按钮,当用户是info.php的页面上,并显示它时再他不是info.php的页面上。

I want to use this to hide the info button in the top bar when the user is on the info.php page and show it again when he is not on the info.php page.

我GOOGLE了,但找不到任何工作code,任何人可以帮助我吗?

I googled but can't find any working code, can anybody help me?

Thx提前!

推荐答案

您可以使用 WebViewClient.shouldOverrideUrlLoading 来检测你的WebViewClient

You can use WebViewClient.shouldOverrideUrlLoading to detect every URL changes on your WebViewClient