import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;
import android.location.LocationManager;
import android.media.AudioManager;
import android.net.Uri;
+import android.os.Handler;
+import android.os.Looper;
import android.preference.PreferenceManager;
import android.provider.ContactsContract.PhoneLookup;
import android.telephony.SmsManager;
* @throws AssertionError if the given object is null
*/
public static <T> 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;
}
break;
case SMS:
- SmsManager.getDefault().sendTextMessage(address.data, null, message, null, null);
+ new Handler(Looper.getMainLooper()).post(new Runnable(){
+ @Override
+ public void run(){
+ final ArrayList<String> parts = SmsManager.getDefault().divideMessage(message);
+ SmsManager.getDefault().sendMultipartTextMessage(address.data, null, parts, null, null);
+ }
+ });
break;
case LOCAL: