Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to send sms using SMSManager in Android
    primarykey
    data
    text
    <p>In my application I <strong>do not</strong> want to use the default message sender. For doing that I followed the following link <a href="https://stackoverflow.com/questions/3600326/in-android-is-it-possible-to-send-sms-message-to-more-than-one-recipient-in-code/3608117#comment11259846_3608117">In Android is it possible to send sms message to more than one recipient in code?</a></p> <ul> <li>And that code worked too. But the messages I am sending from this code are not saved on the phones outbox and inbox.</li> <li><p>I am using sms manager like this in my code </p> <p>SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage(phoneNumber, null, message, null, null);</p></li> </ul> <p>But it is not sending sms.please help me with how can i send sms in android - i have tried following too PendingIntent sentPI = PendingIntent.getBroadcast(this, 0, new Intent( SENT), 0);</p> <pre><code>PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0, new Intent(DELIVERED), 0); SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI); </code></pre> <p>It's also not working.<br> SMSAPPActivity.java</p> <p><strong>EDIT :</strong></p> <pre><code>btnSendSMS.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { String message = txtMessage.getText().toString(); String[] PhnNoArray = new String[2]; PhnNoArray[0] = "9999999999"; PhnNoArray[1] = "8888888888"; // StringTokenizer st = new StringTokenizer(phoneNo, ","); smsManager = SmsManager.getDefault(); for (int i = 0; i &lt; PhnNoArray.length; i++) { smsManager = SmsManager.getDefault(); // this is the function that does all the magic // sms.sendTextMessage(phoneNumber, null, msg, pi, null); smsManager.sendTextMessage(PhnNoArray[i], null, message, null, null); Toast.makeText(getBaseContext(), "SMS sent : " + i, Toast.LENGTH_SHORT).show(); } } }); </code></pre> <p>Please see the edit and tell me what i have done wrong.tost is showing up but sms is not received on other phone by using this code</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload