How to get installed applications in Android and no system apps?

后端 未结 4 425
梦毁少年i
梦毁少年i 2020-12-13 01:05

I want to get all application which appears in the menu screen. But, now I only get the user installed apps or all the application (included the system application).

<
4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-13 01:21

    final PackageManager pm = getActivity().getPackageManager();
    Intent intent = new Intent(Intent.ACTION_MAIN, null);
    intent.addCategory(Intent.CATEGORY_LAUNCHER);
    List apps = pm.queryIntentActivities(intent, PackageManager.GET_META_DATA);
    

提交回复
热议问题