admin管理员组

文章数量:1604910

public static void rateNow(final Context context) {
        try {
            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(Uri.parse("market://details?id=" + getPackageName()));
            intent.setPackage(GoogleMarket.GOOGLE_PLAY);//这里对应的是谷歌商店,跳转别的商店改成对应的即可
            if (intent.resolveActivity(context.getPackageManager()) != null) {
                context.startActivity(intent);
            } else {//没有应用市场,通过浏览器跳转到Google Play
                Intent intent2 = new Intent(Intent.ACTION_VIEW);
                intent2.setData(Uri.parse("https://play.google/store/apps/details?id=" + getPackageName()));
                if (intent2.resolveActivity(context.getPackageManager()) != null) {
                    context.startActivity(intent2);
                } else {
                    //没有Google Play 也没有浏览器
                }
            }
        } catch (ActivityNotFoundException activityNotFoundException1) {
            Log.e(AppRater.class.getSimpleName(), "GoogleMarket Intent not found");
        }
    }

参考:
APP内部跳转Google Play
Android跳转谷歌商店APP详情页面

本文标签: 跳转到详情页androidplayGoogle