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).
<
I had the same requirement. Ultimately I added another condition to filter down the app list. I just checked whether the app has 'launcher intent'.
So, the resultant code looks like...
PackageManager pm = getPackageManager();
List apps = pm.getInstalledApplications(PackageManager.GET_GIDS);
for (ApplicationInfo app : apps) {
if(pm.getLaunchIntentForPackage(app.packageName) != null) {
// apps with launcher intent
if((app.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) == 1) {
// updated system apps
} else if ((app.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
// system apps
} else {
// user installed apps
}
appsList.add(app);
}
}