Android打开应用市场 Android应用市场
程序员文章站
2022-04-03 10:05:18
...
Intent intent = new Intent(); intent.setAction("android.intent.action.MAIN"); intent.addCategory("android.intent.category.APP_MARKET"); PackageManager pm = this.getPackageManager(); List<ResolveInfo> infos = pm.queryIntentActivities(intent, 0); int size = infos.size(); for (int i = 0; i < size; i++) { ActivityInfo activityInfo = infos.get(i).activityInfo; String packageName = activityInfo.packageName; Log.i( TAG, "packageName : " + packageName); }
根据市场包名和App包名打开指定应用市场并进入到App的详情界面:
Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.parse("market://details?id=" + "com.tencent.mm"); intent.setData(uri); intent.setPackage("com.tencent.android.qqdownloader"); startActivity(intent);
上一篇: Java虚拟机中的类加载器的类型
下一篇: jtable实现回车新增一行