获取系统应用列表或非系统应用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wdx_1136346879/article/details/86131066

//获取系统应用列表
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
List activities = getPackageManager().queryIntentActivities(mainIntent, 0);
ResolveInfo info = Activities.get(0);
//判断是否为系统应用 大于0则为系统应用 小于等于0则为非系统应用
if ((info.activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) <= 0) {}

猜你喜欢

转载自blog.csdn.net/wdx_1136346879/article/details/86131066