2

I am working on a live app. I am allocating a specific points to the user as he/she shares our text via email. But, how can I recognize that user has sent an email??

I am using following code,

Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{});                 
email.putExtra(Intent.EXTRA_SUBJECT, "Test");
email.putExtra(Intent.EXTRA_TEXT, "Hey there! Please download the fun app");
email.setType("message/rfc822");
startActivity(Intent.createChooser(email, "Select Email Chooser"));

How can I get the response that user has sent an Email?

Jay Bhalodi
  • 387
  • 3
  • 18
Mitesh Shah
  • 1,649
  • 2
  • 18
  • 37
  • Kinda related, to only get email clients, do this: https://stackoverflow.com/questions/2197741/how-can-i-send-emails-from-my-android-application/41944560#41944560 – Avi Parshan Jan 30 '17 at 20:14

1 Answers1

2

So this cannot be done. Since any application can respond to the Intent there is no guarantee of any result code or result intent.

See:

Get Mail Sent Notification in onActivityResult "Android"

See:

Trivial: Get confirmation of email sent in android

My own personal tests on ICS are showing both email clients returning 0 for the resultCode regardless of whether the user presses back or send.

Community
  • 1
  • 1
xoxol_89
  • 1,235
  • 11
  • 17