0

I have launched email activity from my application ..My problem is how can i know whether Email is sent or not

try {

    Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
    emailIntent.setType("text/html"); 
    emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"Check out this play from http://www.iplaybook.net iPlayBook ");
    emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,"This play was created using<a href='http://www.iplaybook.net'> iPlayBook.</a>");
    final PackageManager pm = getPackageManager();
    @SuppressWarnings("static-access")
    final List<ResolveInfo> matches = pm.queryIntentActivities(emailIntent, pm.MATCH_DEFAULT_ONLY);
    ResolveInfo best = null;
    for (final ResolveInfo info : matches)
    {
        if (info.activityInfo.name.toLowerCase().contains("mail"))
            best = info;
    }
    if (best != null)
    {
        emailIntent.setClassName(best.activityInfo.packageName, best.activityInfo.name);
        startActivit(emailIntent);
    }
}
catch(Exception e) { }

}

plz help..

dave.c
  • 10,910
  • 5
  • 39
  • 62
user1287756
  • 205
  • 2
  • 13

1 Answers1

0

You can't get a confirmation from android to whether an the email is sent. The actual sending of an email is asynchronous by design, so the activity will likely return before the email is actually sent.

Please search the questions in SO before posting a new one

Cheers, RJ

Community
  • 1
  • 1
Richie
  • 9,006
  • 5
  • 25
  • 38