2

I am using this code to open SMS Intent in my Android app. But after Sending SMS it does not come back to my application, when the device has dual sim and it asks the user for sim selection for sending message.

And in certain cases it automatically send the sms without asking for sim selection for certain contacts and come back to app properly.

And also in lollipop it does not show the message body but the receiver receive the message and i am returning to my app perfectly.

    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("smsto:" + phoneNumber));
    intent.putExtra("address", phoneNumber);
    intent.putExtra("sms_body", "message");
    intent.putExtra("exit_on_sent", true);
    startActivity(intent);
Ritu Nagpal
  • 161
  • 1
  • 11

0 Answers0