1

In my app, I'm creating an intenet to send an email... it looks like this

final Intent emailIntent = new Intent(Intent.ACTION_SEND)
                        .putExtra(Intent.EXTRA_EMAIL, new String[]{mBuilder.mEmail})
                        .putExtra(Intent.EXTRA_SUBJECT, mBuilder.mSubject)
                        .putExtra(Intent.EXTRA_TEXT, Html.fromHtml(getBody()))
                        .putExtra(Intent.EXTRA_STREAM, zipUri)
                        .setType("application/zip");
                mBuilder.mContext.startActivity(Intent.createChooser(
                        emailIntent, mBuilder.mContext.getString(R.string.send_using)));

I want to know if it's possible to know if the email was actually sent or not, so I can perform some actions after that happens.

If so, please explain me how and if possible add a code snippet, please.

Thanks in advance.

Jahir Fiquitiva
  • 1,459
  • 3
  • 23
  • 47

2 Answers2

4

I want to know if it's possible to know if the email was actually sent or not

No.

First, there is no requirement that the user chooses an email client for this startActivity() request.

Second, there is nothing in the ACTION_SEND protocol that lets the app offering to share the content know whether or not the user did anything with that content.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

Maybe you could try startActivityForResult() and see whether the resultcode changes depending on what the user did

Julian Os
  • 281
  • 1
  • 15