mcfly
- Forum posts: 286
Feb 3, 2012, 3:57:48 PM via Website
Feb 3, 2012 3:57:48 PM via Website
Hi All
I try to send an Email from my App. For that I call an startActivity(emailIntent).
This works well, but after I sent the email i am back on the android desktop. I like to stay in my app.
Do you have any suggestions ?
Regards and good weekend.
Code:
I try to send an Email from my App. For that I call an startActivity(emailIntent).
This works well, but after I sent the email i am back on the android desktop. I like to stay in my app.
Do you have any suggestions ?
Regards and good weekend.
Code:
1public boolean onOptionsItemSelected(MenuItem item) {
2 switch (item.getItemId()) {
3
4case R.id.contact:
5
6 Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
7 String aEmailList[] = { "mymail@gmail.com" };
8 emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, aEmailList);
9 emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Hello Developer");
10
11 emailIntent.setType("plain/text");
12 emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "");
13
14 startActivity(emailIntent);
15break;
2 switch (item.getItemId()) {
3
4case R.id.contact:
5
6 Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
7 String aEmailList[] = { "mymail@gmail.com" };
8 emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, aEmailList);
9 emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Hello Developer");
10
11 emailIntent.setType("plain/text");
12 emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "");
13
14 startActivity(emailIntent);
15break;
— modified on Feb 3, 2012, 3:58:17 PM
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.