1PackageManager pm = context.getPackageManager();
2ApplicationInfo applicationInfo = pm.getApplicationInfo(packageName, 0);
3if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
4 int appCategory = applicationInfo.category;
5 String categoryTitle = (String) ApplicationInfo.getCategoryTitle(context, appCategory)
6 // ...
7}