android market:// details?id =不适用于app

时间:2011-01-15 21:17:07

标签: java android google-play android-intent

Android market://details?id=<pname>链接不适用于我的其中一个应用,这让我感到疯狂。我拉我的头发有没有人有任何想法?这是我的#34; Wrap It Up Box&#34;刚出现的链接为"Not Found" "The requested item could not be found."(下面的最后一个链接)。如果你搜索Wrap It Up Box它显示得很好,只是直接链接到它不起作用。

public void onClick(View v){
        switch (v.getId()){
        case R.id.morebubrubsoundboardBtn:
            Intent goToMarket = null;
            goToMarket = new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=com.jayavon.bubrubsoundboard"));
            startActivity(goToMarket);
        break;
        case R.id.morefarmvillehelperBtn:
            Intent goToMarket1 = null;
            goToMarket1 = new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=com.jayavon.farmvillehelper"));
            startActivity(goToMarket1);
        break;
        case R.id.morefarmvillehelperfreeBtn:
            Intent goToMarket2 = null;
            goToMarket2 = new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=com.jayavon.farmvillehelperfree"));
            startActivity(goToMarket2);
        break;
        case R.id.morefishvillehelperBtn:
            Intent goToMarket3 = null;
            goToMarket3 = new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=com.jayavon.fishvillehelper"));
            startActivity(goToMarket3);
        break;
        case R.id.morefishvillehelperfreeBtn:
            Intent goToMarket4 = null;
            goToMarket4 = new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=com.jayavon.fishvillehelperfree"));
            startActivity(goToMarket4);
        break;
        case R.id.morelarrysoundboardBtn:
            Intent goToMarket5 = null;
            goToMarket5 = new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=com.jayavon.larrysoundboard"));
            startActivity(goToMarket5);
        break;
        case R.id.moreleonsoundboardBtn:
            Intent goToMarket6 = null;
            goToMarket6 = new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=com.jayavon.leonsoundboard"));
            startActivity(goToMarket6);
        break;
        case R.id.morewrapitupboxBtn:
            Intent goToMarket7 = null;
            goToMarket7 = new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=com.jayavon.wrapitupbox"));
            startActivity(goToMarket7);
        break;
        }
    }

3 个答案:

答案 0 :(得分:5)

我很抱歉,但是你的包裹名称“Wrap It Up Box”中有输入错误。您认为它是com.jayavon.wrapitupbox但实际上com.javavon.wrapitupbox javavon 而不是 jayavon

答案 1 :(得分:2)

部分手机没有Google Store。在这种情况下,您应该使用“https://”:

private String getGooglePlayStoreUrl(){
    String id = activity.getApplicationInfo().packageName; // current google play is   using package name as id

    PackageManager packageManager = activity.getApplicationContext().getPackageManager();
    Uri marketUri = Uri.parse("market://details?id=" + id);
    Intent marketIntent = new Intent(Intent.ACTION_VIEW).setData(marketUri);
    if (marketIntent.resolveActivity(packageManager) != null)
      return "market://details?id=" + id;
    else
      return "https://play.google.com/store/apps/details?id=" + id;
 }

答案 2 :(得分:-1)

您可以使用以下市场链接:

market://details?id=com.nuazure.bookbuffet