Trivial: Get confirmation of email sent in android

后端 未结 4 478
灰色年华
灰色年华 2020-11-30 13:12

After starting an email intent how can I get confirmation that the email has sent or there has been an error back into the activity it was called from?

              


        
4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 13:34

    That really depends on the app that is launched by your Intent. It could be the Gmail app, it could be the Email app, or it could be any third-party app. Because of this, there is no 100% reliable way to determine whether the user actually pressed Send or not.

    The only thing you can do is check if the Gmail and Email apps return anything relevant when called via startActivityForResult and rely on that. But beware that is not reliable because, again, there could be third party apps. Also, since these apps do not specify publicly what they return, they might change that at some point without any notice.

提交回复
热议问题