Tony
Tony

Reputation: 3805

Type a phone number intent

How can I make my app type a given phone number without calling? I use:

Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + phone));
startActivity(callIntent);

But that statement makes a call too.

Upvotes: 1

Views: 81

Answers (2)

Bidhan
Bidhan

Reputation: 10687

You're using ACTION_CALL. You need to use ACTION_DIAL instead.

Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.parse("tel:" + phone));
startActivity(callIntent);

Upvotes: 1

Joseph Roque
Joseph Roque

Reputation: 5146

Replace Intent.ACTION_CALL with Intent.ACTION_DIAL

Upvotes: 1

Related Questions