我送2个短信息,我想有2层烤面包的消息
1)“SMS发送 - 第一号”和
2) “SMS发送 - 第二个数字”
然而,我越来越2条吐司消息既表示消息
1),发生什么事到消息
2)? 缺少了什么?
谢谢。
registerReceiver(new BroadcastReceiver(){
@Override
public void onReceive(Context arg0, Intent arg1) {
switch (getResultCode())
{
case Activity.RESULT_OK:
Toast.makeText(getBaseContext(), "SMS sent - " + arg1.getStringExtra("SendTo"),
Toast.LENGTH_LONG).show();
break;
}
}
}, new IntentFilter(SENT));
SmsManager sms = SmsManager.getDefault();
Intent intent = new Intent(SENT);
intent.putExtra("SendTo", "first number");
PendingIntent sentIntents = PendingIntent.getBroadcast(this, 0, intent, 0);
sms.sendTextMessage("1234", null, message, sentIntents, null);
Intent intent1 = new Intent(SENT);
intent1.putExtra("SendTo", "second number");
PendingIntent sentIntents1 = PendingIntent.getBroadcast(this, 0, intent1, 0);
sms.sendTextMessage("456", null, message, sentIntents1, null);