Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 981
SpyZip Avatar asked Jun 02 '16 14:06

SpyZip


People also ask

What is the default mail app for Android?

How to Set up Gmail App on (Android devices) If your phone or smart device is an Android, your default email app will most likely be Gmail – but that does not mean you need a Gmail account to use it.

Is there a mail app for Android?

Gmail is the most frequently used email app with Android devices, and for good reason. Gmail works beautifully with Android, and it's completely free. It is also integrated with other Google services, which work well on Android devices and is simple to add multiple Gmail accounts to one device.


1 Answers

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); 
like image 64
SpyZip Avatar answered Oct 05 '22 23:10

SpyZip