title: Messages being sent multiple times on Android
body: <p>I'm currently using this bit of code to send messages:</p>
  
  <pre><code>        SmsManager sm = SmsManager.getDefault();
  
          ArrayList&lt;String&gt; parts = sm.divideMessage(M.getString("Content"));
  
          deliveryIntents = new ArrayList&lt;PendingIntent&gt;();
  
          for (int i = 0; i &lt; parts.size(); i++)
          {
              sentIntents.add(PendingIntent.getBroadcast(this, Integer.parseInt(M.getString("ID")), new Intent(SMS_SEND_ACTION), PendingIntent.FLAG_ONE_SHOT));
              deliveryIntents.add(PendingIntent.getBroadcast(this, Integer.parseInt(M.getString("ID")), new Intent(SMS_DELIVERY_ACTION), PendingIntent.FLAG_ONE_SHOT));
          }
  
          sm.sendMultipartTextMessage(M.getString("Number"),null, parts, sentIntents, deliveryIntents);
  </code></pre>
  
  <p>Most of the times the message I’m trying to send is received by the recipient multiple times and I can not figure out why.</p>
  
  <p>I've used log cat and I'm sure I am not calling the code twice.</p>