Skip to content Skip to sidebar Skip to footer

Progmatically Send Sms On Android 8

I want the SMS screen to be dismissed AND control to come to my app automatically after sending the SMS. i'm using this code to send sms: Uri uri = Uri.parse('smsto:' + '074******

Solution 1:

this code works fine in all versions of android

There are hundreds of different apps that might respond to ACTION_SENDTO with an smsto:Uri.

I want the SMS screen to be dismissed AND control to come to my app automatically after sending the SMS

What the SMS client does is up to the developers of the SMS client. And, again, there are hundreds of those.

i'm using this code to send sms

Neither sms_body nor exit_on_sent are documented Intent extras for ACTION_SENDTO. Only some of of the hundreds of SMS clients will honor them.

but in android 8 when i click send my application goes on background

The developers of that SMS client do not honor exit_on_sent, or didn't test that case.

If you want absolute control over the SMS-sending experience, send it yourself, using SmsManager. Otherwise, please understand that you are starting any one of hundreds of possible apps, and those apps will do whatever their developers want.

Post a Comment for "Progmatically Send Sms On Android 8"