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.
JonasCz says Reinstate Monica
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.
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);
}
}
For kotlin
val intent = Intent(Intent.ACTION_DIAL)
intent.data = Uri.parse("tel:0123456789")
startActivity(intent)
来源:https://stackoverflow.com/questions/34596644/android-intent-call-number