gpt4 book ai didi

android - 如何通过单击按钮打开 google play 商店

转载 作者:太空宇宙 更新时间:2023-11-03 11:37:20 25 4
gpt4 key购买 nike

你好,我正在开发我自己的启动器,它有一个按钮,上面写着“Google Play”,我想要它做的是当用户点击这个按钮时,它会将他们带到 google play 商店主页而不是特定的应用程序页面

这是我的代码:

  /** Called when the user clicks the play button */
public void play(View view) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName("com.android.vending","what goes here??"));
intent.putExtra("grace", "Hi");
startActivity(intent);


}

提前致谢

问候

克里斯

最佳答案

其他人也遇到了同样的问题: How to click on Android Button then go to google play apps

public void play(View view) {
Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=com.theopen.android"));
startActivity(intent);
}

代码思路来自用户“MAC”的回答。

关于android - 如何通过单击按钮打开 google play 商店,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21973415/

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