【问题标题】:Chrome intent doesnt work in Android ChromeChrome 意图在 Android Chrome 中不起作用
【发布时间】:2021-04-18 03:46:08
【问题描述】:

我在 chrome 中重定向此链接:

intent:#Intent;package=com.my.package;action=redeye.com.test;category=android.intent.category.DEFAULT;category=android.intent.category.BROWSABLE;S.token=$TOKEN;end

在清单中我为主要活动设置了这个标签

   <intent-filter>
    <action android:name="redeye.com.test" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
  </intent-filter>
  <intent-filter>

但重定向后无法打开我的应用

【问题讨论】:

    标签: android google-chrome android-intent android-manifest


    【解决方案1】:

    您似乎正在寻找新的 Android Intents 链接,该链接将为设备创建和明确的链接意图。

    <a href="intent://<URL>#Intent;scheme=http;package=com.android.chrome;end">
    

    为我工作。所以

    <a href="intent://stackoverflow.com/questions/29250152/what-is-the-intent-to-launch-any-website-link-in-google-chrome#Intent;scheme=http;package=com.android.chrome;end"> 
    

    将带您回答 Chrome 中的这个问题。请注意,方案是单独指定的,因此如果要启动 https 链接,则必须将方案更改为 scheme=https

    但正如大家所说,明确的 Chrome 意图是非常非 Android 的事情。更好的方法是像这样指定 ACTION_VIEW 动作:

    <a href="intent://stackoverflow.com/questions/29250152/what-is-the-intent-to-launch-any-website-link-in-google-chrome#Intent;scheme=http;action=android.intent.action.VIEW;end;">
    

    来源:link

    【讨论】:

      猜你喜欢
      • 2021-12-15
      • 1970-01-01
      • 2018-06-20
      • 2019-04-12
      • 2014-04-04
      • 2013-10-01
      • 2013-06-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多