ArrayList<String> list = smsManager.divideMessage(content);
for (String string : list)
smsManager.sendTextMessage(phone, null, string, null, null);
text messages sent by the above code , the other is to receive a message every split , how to let the other party will split the message received is displayed as the same one it ? ?
------ Solution ---------------------------------------- ----
SmsManager sm = SmsManager.getDefault();
ArrayList<String> parts =sm.divideMessage(LONG_TEXT);
int numParts = parts.size();
ArrayList<PendingIntent> sentIntents = new ArrayList<PendingIntent>();
ArrayList<PendingIntent> deliveryIntents = new ArrayList<PendingIntent>();
for (int i = 0; i < numParts; i++) {
sentIntents.add(PendingIntent.getBroadcast(getContext(), 0, mSendIntent, 0));
deliveryIntents.add(PendingIntent.getBroadcast(getContext(), 0, mDeliveryIntent, 0));
}
sm.sendMultiPartTextMessage(mDestAddr,null, parts, sentIntents, deliveryIntents)
没有评论:
发表评论