I'm trying to replicate the application grid that Android have by default, loading all the "launchable" appliactions.
I do it this way.
//generate the intent to get the application list
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
PackageManager manager = getPackageManager();
applicationList = manager.queryIntentActivities(mainIntent, 0);
//sort the list
Collections.sort(applicationList, new ResolveInfo.DisplayNameComparator(manager));
//user in calculating percentage.
if (applicationList.size() > 0 ){
for (ResolveInfo info : applicationList) {
once I've the list handle it to show the name + icon of the application in a grid view, but when it comes to the camera, I keep getting the Gallery label and icon.
for getting the label I use:
PackageManager manager = getPackageManager();
(String) manager.getApplicationLabel(applicationInfo)
for getting the icon
info.loadIcon(getContext().getPackageManager());
where info is a ApplicationInfo object.
I wonder what could be happening.
so far I've just notice that application but it maybe another.
anyone know how can I get the Camera application from the camera ResolveInfo
while debuging I toke an screen shot this is the information I got for that ResolveInfo
Thanks in advice.
Cesar Glez.