Chrome 意图在 Android Chrome 中不起作用

问题描述

我在 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 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

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...