Android 实现跳转到Google Play 详情页
16lz
2021-01-23
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.com/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详情页面
更多相关文章
- android 调用系统图片浏览器并返回图片路径
- android WebView 应用内点击超链接不调用系统浏览器
- android应用商店完整版源码
- JS判断是IOS还是Android,判断是否微信浏览器
- Android之WebView 防止调用系统浏览器打开页面
- 收集几个移动平台浏览器的User-Agent
- 如何在phonegap中使用自带浏览器打开链接
- Android中浏览器UA的生成策略
- Android调用浏览器打开网页内容