我在我的最新应用程序中有其他应用程序的链接,我以这种方式打开它们。
Uri uri = Uri.parse("url");
Intent intent = new Intent (Intent.ACTION_VIEW, uri);
startActivity(intent);
这段代码会打开google play商店的浏览器版本。
当我试图从手机打开时,手机会提示我是要使用浏览器还是google play,如果我选择了第二种浏览器,它会打开手机版的google play商店。
你能告诉我这是怎么一次发生的吗?我的意思不是问我,而是直接打开google play的移动版本,我在手机上直接打开它时看到的那个版本。
发布于 2013-09-12 15:19:37
下面的代码可以帮助你在移动版本中显示google play sore的应用程序链接。
对于应用程序链接:
Uri uri = Uri.parse("market://details?id=" + mContext.getPackageName());
Intent myAppLinkToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
startActivity(myAppLinkToMarket);
} catch (ActivityNotFoundException e) {
//the device hasn't installed Google Play
Toast.makeText(Setting.this, "You don't have Google Play installed", Toast.LENGTH_LONG).show();
}
对于开发者链接:
Uri uri = Uri.parse("market://search?q=pub:" + YourDeveloperName);
Intent myAppLinkToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
startActivity(myAppLinkToMarket);
} catch (ActivityNotFoundException e) {
//the device hasn't installed Google Play
Toast.makeText(Settings.this, "You don't have Google Play installed", Toast.LENGTH_LONG).show();
}
发布于 2013-08-20 16:28:41
您可以使用Android Intents库在Google Play中打开您的应用程序页面,如下所示:
Intent intent = IntentUtils.openPlayStore(getApplicationContext());
startActivity(intent);
发布于 2013-10-18 15:25:24
https://stackoverflow.com/questions/10922762
复制相似问题