如何增加短信限制长度

时间:2019-05-23 11:17:45

标签: android

有人知道限制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();
    }
}

0 个答案:

没有答案