24

I have my phone number at TextView and want to open "Intent-picker" to choose application that I want to call with(Skype, Viber...) or just dial to call it.

Intent callIntent = new Intent(Intent.ACTION_CALL); calls instantly so it doesn't help me.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Kyryl Zotov
  • 1,788
  • 5
  • 24
  • 44
  • 1
    "want to open "Intent-picker" to choose application or just dial to call it" -- choose what? "...calls instantly so it doesn't help me" -- use `ACTION_DIAL`. – CommonsWare Jan 04 '16 at 17:36
  • There are lots of apps that provide calls. So want to choose from them and basic calling function. – Kyryl Zotov Jan 04 '16 at 17:39

3 Answers3

44

I think you are looking for something like this:

Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:0123456789"));
startActivity(intent); 

This opens the dialer (or creates a chooser dialog if there are multiple apps installed which can place a phone call) with the number filled in, but does not actually start the call. See this answer for more info.

Community
  • 1
  • 1
Jonas Czech
  • 12,018
  • 6
  • 44
  • 65
9

Official Solution

Example intent:

public void dialPhoneNumber(String phoneNumber) {
    Intent intent = new Intent(Intent.ACTION_DIAL);
    intent.setData(Uri.parse("tel:" + phoneNumber));
    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivity(intent);
    }
}
Shihab Uddin
  • 6,699
  • 2
  • 59
  • 74
5

For kotlin

    val intent = Intent(Intent.ACTION_DIAL)
    intent.data = Uri.parse("tel:0123456789")
    startActivity(intent)
kuzdu
  • 7,124
  • 1
  • 51
  • 69