如何使用Intent在Play商店中打开开发者促销页面?

时间:2015-10-02 08:55:47

标签: android android-intent

有像这样的链接(开发者促销页面):

https://play.google.com/store/apps/dev?id=6599001017670379452

enter image description here

可以使用

打开
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(uri)));

但我无法找到 如何直接在Play商店中打开 ,而无需用户在浏览器和Play商店应用之间进行选择。

此解决方案不适用会打开搜索结果:

market://search?q=pub:<publisher_name>

1 个答案:

答案 0 :(得分:1)

试试这段代码:

Intent intent = getPackageManager().getLaunchIntentForPackage("com.android.vending");
if (intent != null) {
    intent.setAction(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("https://play.google.com/store/apps/dev?id=6599001017670379452"));
    startActivity(intent);
}