Android中获取应用市场列表的方法
分类:Android, Java
阅读 (2,416)
Add comments
1月 162017
直接上代码:
1 2 3 4 5 6 7 8 9 10 11 |
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("Market", "PackageName : " + packageName); } |
[…] Android中获取应用市场列表的方法 […]