方案主机不在安卓棒棒糖上工作,点击链接打开应用程序 [英] scheme host not working on android lollipop, click on link to open app

查看:17
本文介绍了方案主机不在安卓棒棒糖上工作,点击链接打开应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用这段代码从链接启动我的应用程序.

I am using this piece of code to launch my app from a link.

<activity
        android:name="com.example.myApp.myClass"
        android:label="@string/app_name" >
    <intent-filter>
        <data
            android:host="customHostName"
            android:scheme="customScheme" />
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.BROWSABLE" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>  

这是href链接,我想最后拿到钥匙.

This is href link, i want to get the key in the end.

customScheme://customHost/49FYTJTF00

它在所有以前版本的 android 上运行良好,但不适用于 Lollipop.
当我单击该链接时,它只显示要启动的浏览器列表.

It is working fine on all previous versions of android, but is not working on Lollipop.
When I click the link it only shows the list of browsers to launch.

我该怎么办?

推荐答案

请使用路径前缀.

   android:pathPrefix="/"

它可能会解决您的问题.请遵循 android 开发者指南 URL.

It might solve your problem. Please follow android developer guide URL.

这篇关于方案主机不在安卓棒棒糖上工作,点击链接打开应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆