title: Putting data in the SMS sent intent?
body: <p>I'd like to send an sms message. If the text is too long, I split it into multiple messages. I'm trying to put some extra info into the "sent" intent to know which part has been sent, and when all the parts are complete:</p>
  
  <pre><code>ArrayList&lt;String&gt; messageParts = ...;
  for (int i = 0; i &lt; messageParts.size(); i++) {
      sms.sendTextMessage(
        address, 
        null, 
        messageParts.get(i), 
        generateIntent(context, messageParts.size(), i), 
        null));
  }
  
  PendingIntent generateIntent(Context context, int partCount, int partIndex)
  {
      Intent intent = new Intent("SMS_SENT");
      intent.putExtra("partCount", partCount);
      intent.putExtra("partIndex", partIndex);
      return PendingIntent.getBroadcast(context, 0, intent, 0);
  }
  </code></pre>
  
  <p>The message is sent, and I catch the intent when each part is sent - but the intent always has the same data in it. For example, "partIndex" is always zero, even though for the second message, it should be one. Seems like the same intent just keeps getting thrown to my broadcast receiver. What's the right way to do this?</p>
  
  <p>Thanks</p>