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拨打电话
最新推荐文章于 2024-06-17 08:44:58 发布