Hello Android gurus,

I would like to do the following:  in my app's 'Help' area, have a
button that launches the default email application and lets users drop
me an email.

That seems simple huh? Let's just create a new Activity ( code
shamelessly stolen from http://www.androidsnippets.org/snippets/29/index.html
) this way:

final Intent emailIntent = new
Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]
{"[email protected]"});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,
"Subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Text");
context.startActivity(Intent.createChooser(emailIntent, "Send
mail..."));

now, that *almost* works. Almost, because there are two problems with
it:

1) when user exits the mail application ( either by actually sending
the email or simply by pressing the 'BACK' button ) then he gets
kicked out of my app entirely ( back to the main screen, while it
should go back to my app! )

2) when having the email application on top, user presses the 'HOME'
button, the Android correctly comes back to the main screen. However,
when I now re-launch my app, user lands in the mail application again,
which is confusing. I would like him to get back to my app's main
activity.

Adding the following line

emailIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);

does not help.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to