Android sspPrefix被忽略 [英] Android sspPrefix is ignored

查看:322
本文介绍了Android sspPrefix被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个意图过滤器,以便在未安装我的应用程序时,用户会链接到Play商店,否则,我的应用程序会打开.最好使用一些自定义数据,但这不是必需的.我找到了此答案,它似乎恰好提供了我想要的.但是,它对我不起作用.Play商店始终会打开.如果我添加了主机属性,则无论提供的实际ID如何,我的应用始终都会打开.因此,似乎在所有情况下sspPrefix属性都将被忽略.有什么理由可能导致这种情况吗?我缺少明显的东西吗?我正在使用targetSdkVersion 23和minSdkVersion 17.

I'm trying to write an intent-filter so that when my app isn't installed, the user gets linked to the Play Store, otherwise my app is opened. Preferably with some custom data, but this isn't essential. I found this answer which seems to provide exactly what I want. However, it doesn't work for me. The Play Store is always opened instead. If I add a host attribute, then my app is always opened, regardless of the actual id provided. So it appears that the sspPrefix attribute is being ignored in all cases. Is there any reason why this might be the case? Am I missing something obvious? I'm using targetSdkVersion 23 and minSdkVersion 17.

更一般地说,是否有更好的方法可以在应用程序页面上打开Play商店,或者如果该应用程序已经安装,则可以打开该应用程序?

More generally, is there a better way to either open the Play Store at an App's page, or that App if it's already installed?

推荐答案

sspPrefix已在API 19中添加.如果您尝试使用的是<19,将无法正常工作.由于XMl的工作方式与之类似,因此它只会忽略以后添加的标签(在未添加API的API级别上没有意义).

sspPrefix was added in API 19. IF you're trying to use a version of Android that's < 19, it will not work. Because XMl works the way it does, it simply ignores tags that are added later (they have no meaning on API levels where it isn't added).

意思是,您最有可能使用的是<19,因此当您尝试访问该应用时,由于API不知道如何处理代码,因此它会打开Goog​​le Play.

Meaning, you're most likely using an API that is < 19, so when you try to access the app it opens google play because the API doesn't know how to handle the tag.

这篇关于Android sspPrefix被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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