This way messages longer than 140 characters are sent correctly
instead of being discarded. Thanks to Valerio Bozzolan for reporting
bug 11.
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;
new Handler(Looper.getMainLooper()).post(new Runnable(){
@Override
public void run(){
- SmsManager.getDefault().sendTextMessage(address.data, null, message, null, null);
+ final ArrayList<String> parts = SmsManager.getDefault().divideMessage(message);
+ SmsManager.getDefault().sendMultipartTextMessage(address.data, null, parts, null, null);
}
});
break;