Android open mail client

后端 未结 2 597
借酒劲吻你
借酒劲吻你 2021-01-13 04:57

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 =         


        
2条回答
  •  甜味超标
    2021-01-13 05:37

    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); 
    

提交回复
热议问题