如何从android应用程序发送多条短信?

如何从android应用程序发送多条短信?,android,Android,对不起,如果这个问题已经被问到或者看起来很愚蠢,但是我被卡住了。我正在编写一个android应用程序,其中应用程序向不同的人发送不同的消息第一个成功发送,但第二个有问题。它没有显示错误,但它没有发送第二条消息。这是我代码的一部分 public void sendSMSMessenger(){ Log.i("Send SMS", ""); try { // SmsManager smsManager = SmsManager.getDefault();

对不起,如果这个问题已经被问到或者看起来很愚蠢,但是我被卡住了。我正在编写一个android应用程序,其中应用程序向不同的人发送不同的消息第一个成功发送,但第二个有问题。它没有显示错误,但它没有发送第二条消息。这是我代码的一部分

public void sendSMSMessenger(){
    Log.i("Send SMS", "");



    try {
            // SmsManager smsManager = SmsManager.getDefault();
             SmsManager.getDefault().sendTextMessage(Emergencyphonenumber, null, "There is an emergency with your "+PatientRelationship+" "+Patientname+" please open the link to find the location   "+"https://www.google.com/maps/place/"+latitude+","+longitude, null, null);
             Toast.makeText(this, "Message Sent (Relative)", Toast.LENGTH_SHORT).show();
             SmsManager.getDefault().sendTextMessage(Doctorphonenumber, null, "There is an emergency with your patient named "+Patientname+" please open the link to find the location   "+"https://www.google.com/maps/place/"+latitude+","+longitude, null, null);
             Toast.makeText(this, "Message Sent (Doctor)", Toast.LENGTH_SHORT).show();





          } catch (Exception e) {
              Toast.makeText(this, "Message Sending failed", Toast.LENGTH_SHORT).show();
             e.printStackTrace();
          }

}   

谢谢……

您不能同时发送消息。在某种程度上,网络很难集体处理所有消息。等一下。增加时间。

这是因为当您试图一个接一个地发送消息时,网络会阻塞。因此,解决方案是,在等待15-30秒后尝试发送下一条消息。希望您能理解。@Lal,您能澄清一下“网络堵塞”是什么意思吗?