检测android webview URL位置变化 [英] Detect android webview URL location change

查看:30
本文介绍了检测android webview URL位置变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有其他人知道如何跟踪一种网络视图onLocationChange"?iOS 的 webview 有类似的东西.

PS - 我想看看我是否可以在 android 上使用 phonegap childbrowser 插件来做 facebook auth.我放弃了,只使用我发现使用 FB android SDK 的一部分的 facebook 插件,但我仍然想知道有什么可能.

解决方案

如果你想操作 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]

这篇关于检测android webview URL位置变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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