0

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!

Marcelo
  • 2,075
  • 5
  • 21
  • 38
  • "Is there a way to list all the apps with a given permission (in my case, the call permission)?" -- you do not need `CALL_PHONE` to dial a phone number. You need `CALL_PHONE` to call a phone number. – CommonsWare Aug 13 '13 at 17:58
  • CommonsWare, thanks. This post is of great help. – Marcelo Aug 13 '13 at 18:00

1 Answers1

0

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
Karakuri
  • 38,365
  • 12
  • 84
  • 104