gpt4 book ai didi

Android 市场 Intent 不起作用,但网页链接可以吗?

转载 作者:行者123 更新时间:2023-11-29 16:21:09 26 4
gpt4 key购买 nike

这行不通

    Intent marketLaunch = new Intent(Intent.ACTION_VIEW);
marketLaunch.setData(Uri.parse("market://details?id=myVirtualHealthCheck.com.Android"));
startActivity(marketLaunch);

但是网络链接确实....

https://market.android.com/details?id=myVirtualHealthCheck.com.Android

这太令人困惑了,有什么想法吗?

最佳答案

我不确定这是否有帮助,但仅供您了解(虽然在您所附的示例代码中似乎您所做的一切都很好)应用程序 ID(=您的包:myVirtualHealthCheck.com.Android)必须准确地写在与android市场中的情况相同。

例如,这段代码将工作:

marketLaunch = new Intent(Intent.ACTION_VIEW);
marketLaunch.setData(Uri.parse("market://details?id=myvirtualhealthcheck.com.android"));
startActivity(marketLaunch);

在上面的示例中,id 是小写的,与 android market 中的实际 id myVirtualHealthCheck.com.Android 相反,因此使用它会导致“找不到页面错误”

关于Android 市场 Intent 不起作用,但网页链接可以吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7259658/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com