Android - Opening the email application?

后端 未结 4 1791
时光说笑
时光说笑 2021-02-01 13:47

I want to open the email application on my android app: The following code crashes Am I doing anything wrong? please provide code

Intent i = new Intent (Intent.A         


        
4条回答
  •  终归单人心
    2021-02-01 14:12

    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.setType("plain/text");
    intent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] {});
    intent.putExtra(android.content.Intent.EXTRA_SUBJECT,"");
    intent.putExtra(android.content.Intent.EXTRA_TEXT, "");
    
    /* Send it off to the Activity-Chooser */
    startActivity(Intent.createChooser(intent,"Send"));
    

提交回复
热议问题