Call intent in Android

前端 未结 7 1299
生来不讨喜
生来不讨喜 2020-12-10 06:16

How can I make call by pressing button? I get my number as a string from EditText. Here is my sample code:

String phone = editPhone         


        
7条回答
  •  孤街浪徒
    2020-12-10 06:36

    String PhoneNo="+923341234567"
    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + PhoneNo));
    startActivity(intent);
    

    and add a permission in manifest

    
    

提交回复
热议问题