嗨,我有一个数字列表。
ArrayList<String> numbers;
我想一起使用 Intent 向所有这些号码发送消息。我用电子邮件做到了这一点,例如向多人发送电子邮件,如何处理消息?
public static void send(Context ctx, String[] addy, String subject,
String body,File attachment) {
try {
Intent sendIntent = new Intent(Intent.ACTION_VIEW);
sendIntent.setType("vnd.android-dir/mms-sms");
sendIntent.putExtra(android.content.Intent.EXTRA_PHONE_NUMBER,
addy);
sendIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
sendIntent.putExtra(android.content.Intent.EXTRA_TEXT, body);
//sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(attachment));
ctx.startActivity(Intent.createChooser(sendIntent,
"Send via which Application?"));
} catch (Exception e) {
Toast.makeText(ctx, "No activity was found to handle this action",
Toast.LENGTH_SHORT).show();
}
}
这是打开消息应用程序,但存储在 addy 中的号码未列在发送到列的消息中