安卓:用指定的多个收件人打开短信活动 [英] Android: Opening SMS activity with multiple recipients specified
问题描述
我想通过启动意图启动手机设置短信提供商。在code,我使用下面是我用什么来启动的意图。
意图sendIntent =新的意图(Intent.ACTION_VIEW);
StringBuilder的URI =新的StringBuilder(短信:);
的for(int i = 0; I< contacts.size();我++){
uri.append(contacts.get(ⅰ).getNumber());
uri.append(,);
}
sendIntent.putExtra(sms_body,);
sendIntent.setType(vnd.android-DIR / MMS,SMS);
sendIntent.setData(Uri.parse(uri.toString()));
startActivity(sendIntent);
我特别想用这个方法,而不是发送自己,所以用户可以使用他们的preferred SMS客户端的消息。我可以得到它只有一个号码,但不能多去。我找不到一个例子与多个收件人的任何地方。这可能吗?
感谢你在前进
意图smsIntent =新的意图(Intent.ACTION_SENDTO,Uri.parse(smsto:5551212; 5551212));
smsIntent.putExtra(sms_body,短信到这里);
startActivity(smsIntent);
添加电话号码以分号分隔列表smsto:作为URI的意向构造。 也可参考此<一个href="http://stackoverflow.com/questions/5448140/sending-sms-to-multiple-people-in-android">LINK
I am trying to start the phone set sms provider by starting an intent. The code I am using below is what I am using to start the intent.
Intent sendIntent = new Intent(Intent.ACTION_VIEW);
StringBuilder uri = new StringBuilder("sms:");
for (int i = 0; i < contacts.size(); i++) {
uri.append(contacts.get(i).getNumber());
uri.append(", ");
}
sendIntent.putExtra("sms_body", "");
sendIntent.setType("vnd.android-dir/mms-sms");
sendIntent.setData(Uri.parse(uri.toString()));
startActivity(sendIntent);
I specifically want to use this method rather than sending the message myself so the user can use their preferred sms client. I can get it going with just one number but not multiple. I can't find an example anywhere with multiple recipients. Is this possible?
Thank you in advance
Intent smsIntent = new Intent(Intent.ACTION_SENDTO,Uri.parse("smsto:5551212;5551212"));
smsIntent.putExtra("sms_body", "sms message goes here");
startActivity(smsIntent);
Add a semicolon delimited list of phone numbers to "smsto:" as the URI in the Intent constructor. Also refer this LINK
这篇关于安卓:用指定的多个收件人打开短信活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!