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

Merge pull request #45 from ZeppLu/long-message

now able to send message longer than the maximum size
This commit is contained in:
Fredrik Fornwall 2016-09-26 23:12:16 +02:00 committed by GitHub
commit fb1ccb8683

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);
}
}
}