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).
<
Below code will give you all the system apps related to Operating System. This will not include Apps like YouTube, Gmail, etc
try {
ApplicationInfo ai = getPackageManager().getApplicationInfo(item.packageName, 0);
if ((ai.flags & ApplicationInfo.FLAG_SYSTEM ) != 0) {
if((ai.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP ) == 0) {
appItem.setSystemApp(true);
Mylog.v("System Apps " + appItem.getAppName());
}
}
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}