Reputation:
To make a phone call, I just click on a button and I'm directly making the phone call. But I want to change that.
What I want, it's when I click on the button, I move to the composer like in this image.
Then, I can confirm ou not the call phone.
Please, can you helpe me ? This is my actual code
buttonCall.setOnClickListener(new View.OnClickListener()
{
public void onClick(View view){
Intent call = new Intent(Intent.ACTION_CALL);
call.setData(Uri.parse("tel:" 1234567));
startActivity(call);
}
});
Upvotes: 1
Views: 522
Reputation: 4707
Use Intent.ACTION_DIAL
or Intent.ACTION_VIEW
instead of Intent.ACTION_CALL
.
From Intent:
ACTION_VIEW tel:123 -- Display the phone dialer with the given number filled in.
ACTION_DIAL tel:123 -- Display the phone dialer with the given number filled in.
Upvotes: 1
Reputation: 5564
I guess you want to show the dialpad with the phone no. Use this in onClick
Intent dial = new Intent();
dial.setAction("android.intent.action.DIAL");
dial.setData(Uri.parse("tel:"+number));
startActivity(dial);
Upvotes: 0