Possible Duplicate:
Programatically send SMS Android (Not receiving status)
I am using this code example word for word except for the fact that I changed
import android.telephony.gsm.SmsManager;
to
import android.telephony.SmsManager;
The SMS is sending fine however I am not getting the TOAST message that it was delivered (sent to the network). I am trying to integrate SMS into my application and this is important. I am sure this can be done because how else would the stock SMS app know when to stop displaying the "sending circle". The relevant code section is as follows:
//---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));
I am using a Jelly Bean ROM but I believe I tested this same segment a while ago on Gingerbread and ICS with the same results. Has the API changed or is there an issue with the sample? I am testing on a Sasmsung GSIII if that helps. My old tests were on an Epic.