Intent with setType(“message/rfc822”) for Android API Level before 2.3.3

前端 未结 3 1247
南方客
南方客 2021-01-13 19:15

I have a problem with setting type "message/rfc822" for intent to send e-mail with file attachment on Android emulator

3条回答
  •  暖寄归人
    2021-01-13 19:58

    I have made an application that uses URI example as you desired:

    if(v.getId()==R.id.button3)
    {
        intent=new Intent(Intent.ACTION_SEND);
        intent.setData(Uri.parse("mailto"));
        String[]to={"akshkatheria@gmail.com","megakatheria@gmail.com"};
        intent.putExtra(Intent.EXTRA_EMAIL, to);
        intent.putExtra(Intent.EXTRA_SUBJECT, "hello");
        intent.putExtra(Intent.EXTRA_TEXT, "hi");
        intent.setType("message/rfc822");
        chooser=intent.createChooser(intent, "send mail");
        startActivity(chooser); 
    }
    

提交回复
热议问题