简体   繁体   English

不直接拨打电话

[英]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);
        }
    });

Use Intent.ACTION_DIAL or Intent.ACTION_VIEW instead of Intent.ACTION_CALL . 使用Intent.ACTION_DIALIntent.ACTION_VIEW代替Intent.ACTION_CALL

From Intent : 意图

ACTION_VIEW tel:123 -- Display the phone dialer with the given number filled in. ACTION_VIEW tel:123-显示带有给定号码的电话拨号器。

ACTION_DIAL tel:123 -- Display the phone dialer with the given number filled in. ACTION_DIAL tel:123-显示带有给定号码的电话拨号器。

I guess you want to show the dialpad with the phone no. 我想您要显示带有电话号码的拨号盘。 Use this in onClick 在onClick中使用它

Intent dial = new Intent();
dial.setAction("android.intent.action.DIAL");
dial.setData(Uri.parse("tel:"+number));
startActivity(dial); 

用这个 :

Intent call = new Intent(Intent.ACTION_DIAL);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM