有没有办法在没有得到确认的情况下发送短信?我目前的代码是:
String phoneNumber = "1234567";
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(Uri.parse("smsto:" + phoneNumber)); // This ensures only SMS apps respond
intent.putExtra("sms_body", "TESTING TEXT MESSAGE! IT WORKS!");
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
答案 0 :(得分:0)
是的,您应该使用SmsManager
。这是一个例子:
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage("phoneNo", null, "sms message", null, null);