How To Launch User's Default Mail Client, Default Window(inbox)
Well I want to redirect user from app to default mail client in his phone. I heard that i can't just make intent that launch mailing app. So the general idea is to get possible ap
Solution 1:
In fact it is possible to launch the Mail client per Intent:
IntentLaunchIntent= getPackageManager().getLaunchIntentForPackage("com.android.email/.activity.EmailActivity");
startActivity( LaunchIntent );
Hope this works for you.
Solution 2:
Try this:
.....
IntentemailIntent=newIntent(Intent.ACTION_SEND);
emailIntent.setType("text/html");
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "some subject");
.....
startActivity(Intent.createChooser(emailIntent, "Email:"));
.....
It swows Dialog with posible email clients. After user choose some, it redirect him to choosen client....
Solution 3:
So i made quick woraround for my problem. I'm letting user decide if to run gmail, on ConversationList, or open email client by himself. I also protected it from crashing when there will be no gmail client on some phone.
Post a Comment for "How To Launch User's Default Mail Client, Default Window(inbox)"