小编JaM*_*Mic的帖子

如何通过浏览器链接启动Android应用程序?

我读了这个2年前的问题,关于如何通过浏览器链接启动应用程序.我按照hackbod的指示不使用自定义方案.

我用以下链接准备一个html站点:

<a href="intent:#Intent;action=android.intent.action.VIEW;category=android.intent.category.DEFAULT;category=android.intent.category.BROWSABLE;package=com.jamic.secapp;end">Sec App</a>
Run Code Online (Sandbox Code Playgroud)

我的manifest.xml的intent-filter部分如下所示:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.jamic.secapp"
...
<intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data android:scheme="intent"/>
</intent-filter>
...
Run Code Online (Sandbox Code Playgroud)

当我在浏览器中打开html网站时(我尝试了标准的android浏览器和dolphin浏览器)并点击链接,浏览器将我重定向到Play-Store并收到消息:

No result found for "pname:com.jamic.secapp"
Run Code Online (Sandbox Code Playgroud)

但是当我用android的标准HTML-Viewer打开html-site时,链接工作正常.

那么什么是错的?我不想成为一个坏男孩并使用自定义方案:P

谢谢你的回答:)

android

6
推荐指数
1
解决办法
943
查看次数

标签 统计

android ×1