Вопрос

I am looking for a way to monitor the sent status of a MMS message started by Intent.ACTION_SEND so that I can return to my original activity upon the message being sent. Currently Im using startActivityForResult() with a request code to start it so theres something to return and display a toast with and I'm also using Intent.putExtra("exit_on_sent", true) so that it exits the default messenger and returns to the original activity when the Send button is pressed but that only gives the illusion that it sent the message and doesn't actually monitor and wait for it to be sent. I have found examples that monitor sms messages that use the smsManager, pending intents, and broadcast receivers, but being a noob I'm uncertain if thats the approach I should use. Any guidance would be appreciated.

Это было полезно?

Решение

I am looking for a way to monitor the sent status of a MMS message started by Intent.ACTION_SEND so that I can return to my original activity upon the message being sent.

That is not possible. First, you have no control over what activity the user chooses to handle your ACTION_SEND. Second, it would be up to the authors of that other activity how to implement a "send" operation, and how they do that is none of your business.

Currently Im using startActivityForResult()

ACTION_SEND is not designed for use with startActivityForResult(); you will not generally get a result.

I'm also using Intent.putExtra("exit_on_sent", true)

Whatever that is, that is undocumented, unsupported, and generally ignored by most implementers of ACTION_SEND.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top