How to return back to intent after sending sms usi

2019-05-07 10:42发布

I'm using below code for sending sms using native sms composer

 Intent intent = new Intent(Intent.ACTION_VIEW);
 intent.putExtra("address", "1234567890");
 intent.putExtra("sms_body", "Hai");     
 intent.setData(Uri.parse("smsto:"+"1234567890"));
   //intent.putExtra("exit_on_sent", true);
 startActivityForResult(intent, 1);

It is working but after sending sms, its not returning back to my activity. If I put intent.putExtra("exit_on_sent", true); then sms body is showing empty in sms composer.

I want showing content in composer and it should return back to my activity after sending sms. Any way to implement this??

1条回答
We Are One
2楼-- · 2019-05-07 11:34

Try this

intent.setData(Uri.parse("smsto:"+"1234567890"));
intent.putExtra("address", "1234567890");
intent.putExtra("sms_body", "Hai");
intent.putExtra("exit_on_sent", true);
startActivityForResult(intent, INVITE_COMPLETED);
查看更多
登录 后发表回答