How to add button to call a specific number

前端 未结 4 1915
滥情空心
滥情空心 2021-01-16 04:09

I want to add a button to my app that will allow the phone to call a particular number. I also want to add message service.

4条回答
  •  情话喂你
    2021-01-16 04:40

    write following code in button.onClickListener,

    String url = "tel:3334444";
    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(url));
    

提交回复
热议问题