Some test code

This commit is contained in:
Mathieu Maret 2010-01-26 18:28:38 +01:00
parent 6c373b51e5
commit 2223c40c93

View File

@ -124,20 +124,24 @@ public class MultiSmsSender extends Activity {
if (!allreadySend.contains(newN)) {
allreadySend.add(newN);
ArrayList<PendingIntent> deliveryIntents = new ArrayList<PendingIntent>(messageCount);
ArrayList<PendingIntent> sentIntents = null;
if (haveDeliveryReports) {
sentIntents = new ArrayList<PendingIntent>(messageCount);
long entryId = mDbHelper.createEntry(mDbHelper.nameFromNumber(newN), newN, deliveryId);
for (int j = 0; j < messageCount; j++) {
Intent intent = new Intent(MessageReceiver.MESSAGE_RECEIVED, null, this, MessageReceiver.class);
intent.putExtra(PARAM_ENTRY_ID, entryId);
sentIntents.add(PendingIntent.getBroadcast(
this, 0, intent , PendingIntent.FLAG_CANCEL_CURRENT));
deliveryIntents.add(PendingIntent.getBroadcast(
this, 0, intent , PendingIntent.FLAG_UPDATE_CURRENT));
}
}
manager.sendMultipartTextMessage(newN, null, messages, null, sentIntents);
manager.sendMultipartTextMessage(newN, null, messages, deliveryIntents, sentIntents);
}
}