且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

检测android webview URL位置变化

更新时间:2023-02-26 14:49:02

如果你想操作 URL 则覆盖这个:

public boolean shouldOverrideUrlLoading (WebView view, String url)

给宿主应用程序一个机会当一个新的url时接管控制即将在当前加载网络视图.

[WebViewClient 参考]

Does anyone else know how to track a sort of webview "onLocationChange"? iOS has something like this for its webview.

PS - I am trying to see if I can use the phonegap childbrowser plugin on android to do facebook auth. I'm giving up and just using a facebook plugin I found that uses part of the FB android SDK, but I'd still like to know what's possible.

If you want to manipulate the URL then override this:

public boolean shouldOverrideUrlLoading (WebView view, String url)

Give the host application a chance to take over the control when a new url is about to be loaded in the current WebView.

[WebViewClient Reference]