android - 如何在 webview 中捕获网站重定向

标签 android redirect webview paypal

我正在尝试设置应用内 PayPal MECL 交易。

交易完成或失败后,PayPal 将重定向到失败的 url 或交易完成的 url..

我如何获取该 url 以查看交易是否已完成?

最佳答案

多个选项

Intent 过滤器:

  <activity android:name=".ActivityTest">
    <intent-filter><action android:name="android.intent.action.VIEW"></action>
      <category android:name="android.intent.category.DEFAULT"></category>
      <category android:name="android.intent.category.BROWSABLE"></category>
      <data android:host="www.mywebsite.com" android:scheme="http"></data>
    </intent-filter>
  </activity>

如此处所述:https://groups.google.com/forum/#!topic/android-developers/C6qNOBULpCc 官方文档在这里:http://developer.android.com/guide/topics/manifest/intent-filter-element.html

或者WebViewClient:

Clicking URLs opens default browser

关于android - 如何在 webview 中捕获网站重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8588071/

相关文章:

java - 无法解析符号 'ButterKnife'

.net - 检测asp.net将用户重定向到登录页面

php - 重定向 .htaccess 文件中的绝对路径

c# - 在 MVC 中重定向来自旧网站的请求

javascript - Android WebView 无法找到 JavaScript 函数

android - 如何重新测量 layout_weight?

android - 密码保护 Android 中的首选项

java - 使用 Retrofit rxjava concatWith 时发生堆栈溢出

javascript - WebView 代码在 Android 4.4.2 (API 19) 模拟器上生成 Uncaught TypeError 和 Uncaught ReferenceError 错误

iphone - 突出显示 PDF 文档 iPhone xcode 中的文本