Message does not send smsManager on some phones

I am trying to send an smsManager message. But on some Samsung phones, it cannot send messages and does not display an error.

Here is my code

try { SmsManager sms = SmsManager.getDefault(); Toast.makeText(context, "" + phoneNumber + ": " + messageText, Toast.LENGTH_SHORT).show(); PendingIntent sentPI = PendingIntent.getBroadcast(getActivity(), 0, new Intent("SMS_SENT"), 0); PendingIntent deliveredPI = PendingIntent.getBroadcast(getActivity(), 0, new Intent("SMS_DELIVERED"), 0); sms.sendTextMessage(phoneNumbers, null, messageText, sentPI, deliveredPI); } catch (Exception e) { Toast.makeText(context, "Sms not Send " + e, Toast.LENGTH_SHORT).show(); e.printStackTrace(); } 

Even I used com.klinker.android.send_message , but it doesn’t even perform

 [2013-10-29 13:57:50 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/google/gson/JsonSerializer; [2013-10-29 13:57:50 - kluebook] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/gson/JsonSerializer; 

`

0
source share
2 answers

1.) Restart Eclipse.

2.) Delete the bin and gen folder.

3.) Clean project and build again.

0
source

If you are using android 6.0 and above, add codes for runtime permissions in your project.

0
source

Source: https://habr.com/ru/post/1498352/


All Articles