首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >手机版android中google play商店的打开链接

手机版android中google play商店的打开链接
EN

Stack Overflow用户
提问于 2012-06-07 05:45:40
回答 4查看 135K关注 0票数 88

我在我的最新应用程序中有其他应用程序的链接,我以这种方式打开它们。

代码语言:javascript
复制
Uri uri = Uri.parse("url");
Intent intent = new Intent (Intent.ACTION_VIEW, uri); 
startActivity(intent);

这段代码会打开google play商店的浏览器版本。

当我试图从手机打开时,手机会提示我是要使用浏览器还是google play,如果我选择了第二种浏览器,它会打开手机版的google play商店。

你能告诉我这是怎么一次发生的吗?我的意思不是问我,而是直接打开google play的移动版本,我在手机上直接打开它时看到的那个版本。

EN

回答 4

Stack Overflow用户

发布于 2013-09-12 15:19:37

下面的代码可以帮助你在移动版本中显示google play sore的应用程序链接。

对于应用程序链接:

代码语言:javascript
复制
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();
              }

对于开发者链接:

代码语言:javascript
复制
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();

            } 
票数 6
EN

Stack Overflow用户

发布于 2013-08-20 16:28:41

您可以使用Android Intents库在Google Play中打开您的应用程序页面,如下所示:

代码语言:javascript
复制
Intent intent = IntentUtils.openPlayStore(getApplicationContext());
startActivity(intent);
票数 3
EN

Stack Overflow用户

发布于 2013-10-18 15:25:24

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10922762

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档