SpyZip
SpyZip

Reputation: 5540

Android open mail client

How can I open mail client from my app, NOT SENDING EMAIL just open the inbox? when I use

Intent intent = new Intent(Intent.ACTION_VIEW);
        Uri data = Uri.parse("mailto:[email protected]?subject=" + "" + "&body=" + "");
        intent.setData(data);
        startActivity(intent);

It opens the send mail view, and I want to open the inbox.

Upvotes: 5

Views: 4370

Answers (2)

Daniel Beltrami
Daniel Beltrami

Reputation: 776

You can just use in your xml, like this:

android:autoLink="email"

Upvotes: 0

SpyZip
SpyZip

Reputation: 5540

From @CommonsWare answer

This is what worked for me:

Intent intent=Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, Intent.CATEGORY_APP_EMAIL);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//Min SDK 15
            startActivity(intent); 

Upvotes: 18

Related Questions