【问题标题】:Android deeplink - don't show intent chooser popup, force open appAndroid 深层链接 - 不显示意图选择器弹出窗口,强制打开应用
【发布时间】:2020-09-09 14:27:37
【问题描述】:

当用户打开我的应用处理的任何链接时,我想从浏览器打开我的应用。所以我正在使用深度链接。这是我在清单文件中的代码。

<activity
            android:name=".ColorCaptureActivity"
            android:label="@string/title_activity_color_capture"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter android:label="DeepLink">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.BROWSABLE"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:scheme="http"
                    android:host="www.somelink.com"/>
            </intent-filter>
        </activity>

一切都很好,但是当我单击链接时,android 会显示意图选择器,其中显示了可以处理此意图的所有应用程序。我知道这是默认行为,但有没有办法不显示选择器弹出窗口并直接打开我的应用程序?

【问题讨论】:

  • www.somelink.com 是您自己的域和您自己的网站吗?
  • 没有。但是你能解释一下我的两种情况吗?例如。这是我自己的,在第二种情况下,它不是我的网站。
  • "No" -- 那么你不能强迫用户使用你的应用。对于您拥有和控制的域,请使用developer.android.com/training/app-links/…
  • 非常感谢

标签: android android-intent manifest deep-linking android-intent-chooser


【解决方案1】:

尝试实现 App Links 以将您的应用程序设置为链接的默认处理程序。

参考:https://developer.android.com/training/app-links#app-links-vs-deep-links

【讨论】:

  • 请勿发布仅链接问题。
  • 为什么不呢?这个问题已经很老了,但这个人给出了正确的答案。
猜你喜欢
  • 1970-01-01
  • 2019-05-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-02-17
  • 2011-03-30
相关资源
最近更新 更多