有没有办法直接从我的应用程序打开Google Play商店应用程序并搜索我需要从我的应用程序传递的软件包?
答案 0 :(得分:3)
launchIntent = new Intent(Intent.ACTION_VIEW);
launchIntent.setData(Uri.parse("market://details?id=" + packageName));
startActivity(launchIntent);
答案 1 :(得分:1)
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("http://play.google.com/store/apps/details?id=" + appPackageName)));
}