【问题标题】:Android app opens all http linksAndroid 应用打开所有 http 链接
【发布时间】:2016-10-19 20:54:55
【问题描述】:

我在清单中添加了两个 url 方案:

     <intent-filter android:autoVerify="true"
            android:label="@string/app_name">
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data android:host="appinsider.mobile/"
                android:scheme="http"/>
            <data
                android:host="appinsiderlink/"
                android:scheme="http" />

        </intent-filter>

但除了这些 URL,应用程序会打开所有以“http”开头的链接 如何只打开清单中声明的​​链接?

【问题讨论】:

    标签: android url-scheme


    【解决方案1】:

    我认为android:host="appinsiderlink/" 标签必须是有效的 URI 主机(例如,google.com)。它可能也不应该有一个尾部斜杠。

    你还设置了&lt;intent-filter android:autoVerify="true"&gt;,但没有提到你是否也采取了必要的步骤来设置declare website associations...

    【讨论】:

      猜你喜欢
      • 2019-11-07
      • 1970-01-01
      • 2021-10-14
      • 2021-01-27
      • 1970-01-01
      • 2015-03-10
      • 1970-01-01
      • 2023-03-06
      • 1970-01-01
      相关资源
      最近更新 更多