PHP
·
发表于 5年以前
·
阅读量:8410
public static void call(String phoneNumber) {
try {
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + phoneNumber));
startActivity(intent);
} catch (Exception e) {
Log.e("SampleApp", "Failed to invoke call", e);
}
}
public static void callDial(Context context, String phoneNumber) {
context.startActivity( new Intent(Intent.ACTION_DIAL, Uri.parse( "tel:" + phoneNumber)));
}