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********; 074********");
Intent smsSIntent = new Intent(Intent.ACTION_SENDTO, uri);
smsSIntent.putExtra("sms_body", "iconference sms");
sendIntent.putExtra("exit_on_sent", true);
startActivity(smsSIntent);
this code works fine in all versions of android but in android 8 when i click send my application goes on background can you help me ?
There are hundreds of different apps that might respond to
ACTION_SENDTO
with ansmsto:
Uri
.What the SMS client does is up to the developers of the SMS client. And, again, there are hundreds of those.
Neither
sms_body
norexit_on_sent
are documentedIntent
extras forACTION_SENDTO
. Only some of of the hundreds of SMS clients will honor them.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.