【问题标题】:How to catch a website redirect in a webview如何在 webview 中捕获网站重定向
【发布时间】:2012-01-25 03:52:50
【问题描述】:

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

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

如何获取该网址以查看交易是否完成?

【问题讨论】:

  • 使用与您的网址匹配的意图过滤器
  • thnx,我想这会解决我的问题
  • 你在使用服装网页视图吗?
  • @njzk2 是的..但是如果我在那个页面上搜索一些东西,那么 url 也会被匹配。我不想做任何事情。我只想抓住重定向。

标签: android redirect webview paypal


【解决方案1】:

多种选择

意图过滤器:

  <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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-18
    • 2015-01-31
    • 2018-08-23
    相关资源
    最近更新 更多