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

前端 未结 3 1323
南方客
南方客 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 20:13

    This is the solution. Use the below code, works perfectly...Got the solution after research.... :)

    Intent testIntent = new Intent(Intent.ACTION_VIEW);
    Uri data = Uri.parse("mailto:?subject=" + "blah blah subject" + "&body=" + 
    "blah blah body" + "&to=" + "sendme@me.com");  
    testIntent.setData(data);  
    startActivity(testIntent);  
    

提交回复
热议问题