Java android, how to know if a sms is successfully sent?
<p>How I can know if a sms is successfully sent ?</p>

<p>I have checked the documentation, but I did not find a way to fix my problem...
How can I know that ?</p>

<pre><code>//---when the SMS has been sent---
        registerReceiver(new BroadcastReceiver(){
            @Override
            public void onReceive(Context arg0, Intent arg1) {
                switch (getResultCode())
                {
                    case Activity.RESULT_OK:
                        Toast.makeText(getBaseContext(), "SMS sent",Toast.LENGTH_SHORT).show();
                        getServerData("http://site.com","id",Id);

                        break;
                    case SmsManager.RESULT_ERROR_GENERIC_FAILURE:
                        System.exit(0);
                        Toast.makeText(getBaseContext(), "Generic failure", Toast.LENGTH_SHORT).show();
                        break;
                    case SmsManager.RESULT_ERROR_NO_SERVICE:
                        System.exit(0);
                        Toast.makeText(getBaseContext(), "No service", Toast.LENGTH_SHORT).show();
                        break;
                    case SmsManager.STATUS_ON_SIM_UNSENT:
                        System.exit(0);
                        Toast.makeText(getBaseContext(), "Message unsent", Toast.LENGTH_SHORT).show();
                        break;

                    case SmsManager.RESULT_ERROR_NULL_PDU:
                        System.exit(0);
                        Toast.makeText(getBaseContext(), "Null PDU", Toast.LENGTH_SHORT).show();
                        break;
                    case SmsManager.RESULT_ERROR_RADIO_OFF:
                        System.exit(0);
                        Toast.makeText(getBaseContext(), "Radio off", Toast.LENGTH_SHORT).show();
                        break;
                    case SmsManager.STATUS_ON_SIM_SENT :
                        System.exit(0);
                        Toast.makeText(getBaseContext(), "Message sent", Toast.LENGTH_SHORT).show();
                        break;
                }
            }
        }, new IntentFilter(SENT));

        //---when the SMS has been delivered---
        registerReceiver(new BroadcastReceiver(){
            @Override
            public void onReceive(Context arg0, Intent arg1) {
                switch (getResultCode())
                {
                    case Activity.RESULT_OK:
                        //Toast.makeText(getBaseContext(), "SMS delivered", Toast.LENGTH_SHORT).show();
                        break;
                    case Activity.RESULT_CANCELED:
                       // Toast.makeText(getBaseContext(), "SMS not delivered", Toast.LENGTH_SHORT).show();
                        break;                      
                }
            }
        }, new IntentFilter(DELIVERED));        





        if(isMobileAvailable(getApplicationContext()) == true){
            Toast.makeText(getApplicationContext(), "Reseau mobile: OK !", Toast.LENGTH_LONG).show();

             ArrayList&lt;String&gt; parts = (ArrayList&lt;String&gt;) splitInChunks(message, 120);
               for (String str : parts) {
                   SmsManager sms = SmsManager.getDefault();
                   sms.sendTextMessage(phoneNumber, null, str, null, null);
              }
               getServerData("http://site.com","id",Id);

        }else
            Toast.makeText(getApplicationContext(), "Reseau mobile: NOK !", Toast.LENGTH_LONG).show();
    }
</code></pre>

<p>I juste want to know if my sms is successfuly sended...
tranks you !</p>
