有人知道限制SMS
长度增加的源代码吗?
这是我的代码:
void sendIt() {
try {
PendingIntent sentPI = PendingIntent.getBroadcast(this, 0, new Intent(SENT), 0);
SmsManager smsManager = SmsManager.getDefault();
ArrayList<String> messageArray = smsManager.divideMessage(smsStr);
ArrayList<PendingIntent> sentIntents = new ArrayList<PendingIntent>();
for (int i = 0; i < messageArray.size(); i++){
sentIntents.add(sentPI);
}
smsManager.sendMultipartTextMessage(phoneNumber,null,messageArray,sentIntents, null);
} catch (Exception e) {
Toast.makeText(getApplicationContext(), "failed to " + nmbers.get(i), Toast.LENGTH_LONG).show();
}
}