android拨打电话



String str = mPhone.getText().toString();
if (PhoneNumberUtils.isGlobalPhoneNumber(str)) {
    String sPhone = "tel://" + str;
    Intent i = new Intent(Intent.ACTION_DIAL, Uri.parse(sPhone));
    startActivity(i);
} else {
    Toast.makeText(main.this, "不能拨号", Toast.LENGTH_LONG).show();
}

你可能感兴趣的:(android拨打电话)