Android Intent.ACTION_CALL, Uri

前端 未结 9 726
南笙
南笙 2020-12-05 16:12

I am trying to use the Intent.Action class. I know how to use the ACTION_VIEW to display a URL but I wanted to use the Intent.ACTION_DIAL to call number when th

9条回答
  •  情歌与酒
    2020-12-05 16:46

    try this

    String no = "536171839";
    Intent callintent = new Intent(android.intent.action.CALL);
    callintent.setData(Uri.parse("tel:" +no));
    startActivity(callintent);
    

    add this to your AndroidManifest.xml file

     
    

提交回复
热议问题