Search code examples
androidphone-call

Making a phone call not directly


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

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.