views:

111

answers:

2

Basically, I want to get a list of all installed apps and pick one to run from an activity.

I've tried ACTION_PICK with Intents but that seems to leave out apps that were downloaded and it has a bunch of junk in it.

Thanks

+1  A: 

Not exactly a duplicate, but the info you need is here.

Macarse
+1  A: 
// to get the list of apps you can launch
Intent intent = new Intent(ACTION_MAIN);
intent.addCategory(CATEGORY_LAUNCHER);
List<ResolveInfo> infos = getPackageManager().queryIntentActivities(intent, 0);

// resolveInfo.activityInfo.packageName = packageName
// resolveInfo.activityInfo.name = className
// reusing that intent
intent.setClassName(packageName, className);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
startActivity(intent)

Hope that's enough to help you figure out.

alex
thanks I'll try this out later
2Real
I tried this but it doesn't show all the applications that are installe, for instance, ones that are downloaded.
2Real