【发布时间】:2014-01-09 13:13:41
【问题描述】:
我想向五个不同的号码发送消息。我通过使用 getIntent() 方法从另一个页面获取这些数字。任何人都可以请给一个正确的方式来发送消息。我使用了以下代码。但它祝酒“短信发送到第一个号码”,然后所有其他消息都失败了。!!但问题是我什至没有收到任何消息。!!
try{
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage( phonenumber1 ,null,message,null, null);
Toast.makeText(getApplicationContext(), "SMS Sent to First Number.!",Toast.LENGTH_LONG).show();
}catch(Exception e)
{
Toast.makeText(getApplicationContext(), "SMS Sent failed to First Number.!",Toast.LENGTH_LONG).show();
e.printStackTrace();
} // like this up to phonenumber5 with the same try and catch block each five times
【问题讨论】:
-
如果您的消息多于 1 条消息,则 stackoverflow.com/questions/4774009/…
-
什么名字.??你是说。?
-
好的。我得到了它。!!但我不知道我应该采用和放置哪个代码。请帮帮我。建议我正确的代码。??从那个例子
-
您如何通过意图发送号码?在字符串数组中?