如何从Android应用程序发送多个短信?

时间:2015-05-17 17:22:27

标签: android

很抱歉,如果这个问题已经被问到或者看起来很愚蠢,但我被困住了。我正在编写一个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();
          }

}   

谢谢....

1 个答案:

答案 0 :(得分:0)

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