Question

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);
        }
    });
Was it helpful?

Solution

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.

OTHER TIPS

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); 

Use this :

Intent call = new Intent(Intent.ACTION_DIAL);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top