I am trying to Display a Toast When the Message is Successfully Sent from android in-built app. but i not found any satisfactory result over the internet. Please help me out with some useful links.
Asked
Active
Viewed 557 times
-3
-
sorry. there is no broadcast receiver for sms sent due to its usage of `SMSManager` class. – Murtaza Khursheed Hussain Jan 29 '15 at 05:28
-
Thanks for response, but i am not getting what i am looking for . i also went through Mike M link but its not work for me.help me out with showing toast on sending sms from android inbuilt app.thanks in advance – chandan chaudhary Jan 29 '15 at 06:12
-
Thanks !!!@ Mike M link works exactly i am looking for ...Thanks a ton... – chandan chaudhary Jan 29 '15 at 07:44
1 Answers
1
Use PendingIntent object to monitor the status of the SMS:
PendingIntent sentPI = PendingIntent.getBroadcast(this, 0,
new Intent(SENT), 0);
And Broadcast Receiver objects to display a Toast:
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();
}
}
}, new IntentFilter(SENT));
Refer this link for more details,it may help you:http://mobiforge.com/design-development/sms-messaging-android

Giridharan
- 708
- 7
- 16
-
thanks for your response but the link actually using smsmanager class which is used for sending sms from your own app bt i am looking for displaying toast when i send sms from android inbuilt sms app.please help out with that relavence. – chandan chaudhary Jan 29 '15 at 06:10