📜  如何获取应用程序类别 android packagemanager - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:42.586000             🧑  作者: Mango

代码示例1
PackageManager pm = context.getPackageManager();
ApplicationInfo applicationInfo = pm.getApplicationInfo(packageName, 0);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
    int appCategory = applicationInfo.category;
    String categoryTitle = (String) ApplicationInfo.getCategoryTitle(context, appCategory)
    // ...
}