在我的应用中,我想要一个按钮,该按钮会将用户带到另一个应用的Google Play商店应用页面。
我希望它在Play商店而不是浏览器中打开。
答案 0 :(得分:0)
final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
} catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
}