ActivityManager mActivityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); final PackageManager packageManager = getPackageManager(); List<ResolveInfo> apps = packageManager.queryIntentActivities( mainIntent, 0); for (int i = 0; i < apps.size(); i++) { ResolveInfo info = apps.get(i); Log.e("TAG", info.activityInfo.loadLabel(packageManager) + " pkgName " + info.activityInfo.applicationInfo.packageName + " className " + info.activityInfo.name); }
原文地址:http://blog.csdn.net/lixiaolei5446/article/details/41823445