title: Android: How to send multiple sms via intent (diff phone no and body)
body: <p>I'm using following code for sending text message via Intent ( can not ask for permission so smsmanager is not an option)</p>
  
  <pre><code>//Code from this question 
  //  &lt;http://stackoverflow.com/questions/20079047/android-kitkat-4-4-hangouts-cannot-handle-sending-sms-intent&gt;
      private void sendsms(String toContact, String text){
          Intent intent;
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.KITKAT) // Android 4.4 and up
          {
              String defaultSmsPackageName = Telephony.Sms.getDefaultSmsPackage(this);
  
  
              intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:" + Uri.encode(toContact)));
              intent.putExtra("sms_body", text);
  
              if (defaultSmsPackageName != null) // Can be null in case that there is no default, then the user would be able to choose any app that supports this intent.
              {
                  intent.setPackage(defaultSmsPackageName);
              }
          }
          else
          {
              intent = new Intent(Intent.ACTION_VIEW);
              intent.setType("vnd.android-dir/mms-sms");
              intent.putExtra("address", toContact);
              intent.putExtra("sms_body", text);
          }
          this.startActivity(intent);
      }
  </code></pre>
  
  <p>and I'm calling this in a <code>for</code> loop :</p>
  
  <pre><code>for(int i = 0; i&lt;4 ;i++) {
      sendsms(phoneNo[i],smsBody[i]);
     }
  </code></pre>
  
  <p>Now the problem is whenever user gets to this line, the void will be called 4 times, but user will only see the last message in the devices default messaging app ready to be sent, but to get to the other ones, user should press back on the device and if not, he/she would never see the other messages.</p>
  
  <p>what I need to be done is using a method like <code>startActivityForResult();</code> so each time user sends the message he would be redirected to my app, and then my app starts another activity for the next text message.</p>
  
  <p>any idea?</p>
  
  <p>Thanks in advance</p>