您无法通过Intent执行此操作,因为Android SMS应用程序不允许多个收件人.
您可以尝试使用该SmsManager课程.
首先,您需要android.permission.SEND_SMS在AndroidManifest中申请权限.
然后你可以沿着这些方向做点什么.
// you need to import the Sms Manager
import android.telephony.SmsManager;
// fetch the Sms Manager
SmsManager sms = SmsManager.getDefault();
// the message
String message = "Hello";
// the phone numbers we want to send to
String numbers[] = {"555123456789", "555987654321"};
for(String number : numbers) {
sms.sendTextMessage(number, null, message, null, null);
}
Run Code Online (Sandbox Code Playgroud)
// string input by a user
String userInput = "122323,12344221,1323442";
// split it between any commas, stripping whitespace afterwards
String numbers[] = userInput.split(", *");
Run Code Online (Sandbox Code Playgroud)
对于团体短信或多个短信使用此
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
i.putExtra("address", "987385438; 750313; 971855;84393");
i.putExtra("sms_body", "Testing you!");
i.setType("vnd.android-dir/mms-sms");
startActivity(i);
//use permission: <uses-permission android:name="android.permission.SEND_SMS"/>
Run Code Online (Sandbox Code Playgroud)
您可以使用您的联系电话修改“ 9873854; 750313; 971855; 84393”
| 归档时间: |
|
| 查看次数: |
11772 次 |
| 最近记录: |