X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=src%2Fro%2Fieval%2Ffonbot%2FUtils.java;h=be7923ba5694d7c1eb169c0eb649fc9cfad8f4cc;hb=0bcf6b2e55caca54187c6011eaa174297480731e;hp=9a23d04afcd09f585b16c448274176fdbca51bff;hpb=24ebe0410d664e354a3ac6bdfb2d52188f889ab6;p=fonbot.git diff --git a/src/ro/ieval/fonbot/Utils.java b/src/ro/ieval/fonbot/Utils.java index 9a23d04..be7923b 100644 --- a/src/ro/ieval/fonbot/Utils.java +++ b/src/ro/ieval/fonbot/Utils.java @@ -4,6 +4,7 @@ import static ro.ieval.fonbot.R.string.*; import java.net.MalformedURLException; import java.net.URL; +import java.util.ArrayList; import java.util.Arrays; import java.util.Locale; @@ -190,10 +191,8 @@ public final class Utils { * @throws AssertionError if the given object is null */ public static T toNonNull(@Nullable T object) throws AssertionError{ - if(object==null){ - Log.wtf(Utils.class.getName(), "toNonNull called with null"); - throw new AssertionError("Log.wtf did not terminate the process"); - } + if(object==null) + throw new NullPointerException(); return object; } @@ -304,7 +303,8 @@ public final class Utils { new Handler(Looper.getMainLooper()).post(new Runnable(){ @Override public void run(){ - SmsManager.getDefault().sendTextMessage(address.data, null, message, null, null); + final ArrayList parts = SmsManager.getDefault().divideMessage(message); + SmsManager.getDefault().sendMultipartTextMessage(address.data, null, parts, null, null); } }); break;