【发布时间】:2013-11-05 07:57:57
【问题描述】:
我正在使用 android 代码的 sn-p 来学习如何启动应用程序和制作启动器,但我不知道如何过滤掉诸如 faceunlock 和 facebok 之类的应用程序以实现 htc 感知和类似的应用程序
public static List<ApplicationInfo> getInstalledApplication(Context context) {
PackageManager packageManager = context.getPackageManager();
Intent main = new Intent(Intent.ACTION_MAIN, null);
main.addCategory(Intent.CATEGORY_LAUNCHER);
List<ApplicationInfo> apps = packageManager.getInstalledApplications(0);
Collections.sort(apps, new ApplicationInfo.DisplayNameComparator(packageManager));
return apps;
}
我知道我可能有一些简单的错误,但我似乎找不到它,请帮助并解释答案,以便我可以从中学习:如果需要,我会发布更多代码
【问题讨论】:
标签: android filter categories launcher