1
0
mirror of https://github.com/danog/termux-api.git synced 2024-11-30 04:19:20 +01:00

now able to send message longer than the maximum size

This commit is contained in:
Zepp Lu 2016-09-26 00:15:12 +08:00
parent fbf628fefd
commit 05a9ad60bd

View File

@ -7,6 +7,7 @@ import com.termux.api.util.ResultReturner;
import com.termux.api.util.TermuxApiLogger;
import java.io.PrintWriter;
import java.util.ArrayList;
public class SmsSendAPI {
@ -26,8 +27,9 @@ public class SmsSendAPI {
if (recipients == null || recipients.length == 0) {
TermuxApiLogger.error("No recipient given");
} else {
final ArrayList<String> messages = smsManager.divideMessage(inputString);
for (String recipient : recipients) {
smsManager.sendTextMessage(recipient, null, inputString, null, null);
smsManager.sendMultipartTextMessage(recipient, null, messages, null, null);
}
}
}