My app is trying to send a sms to another number. I have the requisite permission(SEND_SMS) granted by the user. The message however does not get sent.The default messaging app display the message with a "failure to send/Resend" prompt. What is the reason behind this and how do I fix this? My code is pretty straightforward-
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phoneno, null, txt, null, null);
Note- My app operates well below the sms frequency limit Edit : It works fine when run from an activity but fails when run from a service. What's the reasoning behind this ?