I asked a similar question to this earlier this week but I\'m still not understanding how to get a list of all installed applications and then pick one to run.
I\'v
@Jas: I don't have that code anymore, but I've found something close. I've made this to search for "components" of my application, they are just activities with a given category.
private List getInstalledComponentList() {
Intent componentSearchIntent = new Intent();
componentSearchIntent.addCategory(Constants.COMPONENTS_INTENT_CATEGORY);
componentSearchIntent.setAction(Constants.COMPONENTS_INTENT_ACTION_DEFAULT);
List ril = getPackageManager().queryIntentActivities(componentSearchIntent, PackageManager.MATCH_DEFAULT_ONLY);
List componentList = new ArrayList();
Log.d(LOG_TAG, "Search for installed components found " + ril.size() + " matches.");
for (ResolveInfo ri : ril) {
if (ri.activityInfo != null) {
componentList.add(ri.activityInfo.packageName);// + ri.activityInfo.name);
Log.d(LOG_TAG, "Found installed: " + componentList.get(componentList.size()-1));
}
}
return componentList;
}
I've commented the part where it gets the activity name, but it's pretty straightforward.