How can I detect/list apps that can dial?

188 Views Asked by At

Buddies,

Talking directly: in Android, how can I grab/list (from my app) all the apps that can perform dialing operations? Is there a way to list all the apps with a given permission (in my case, the call permission)?

Second part: when user is performing a call (from my app), how can I let him to choose which app he want to make this call (redirect call operation), my app or other app dialers?

Thanks in advance!

1

There are 1 best solutions below

0
On

For part 1, you can do this:

Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phoneNumber));
PackageManager pm = getPackageManager(); // or context.getPackageManager();
List<ResolveInfo> activities = pm.queryIntentActivities(intent, 0);
// iterate over the list of ResolveInfo objects