Launching Messaging application with a body text

感情迁移 提交于 2019-12-23 17:43:55

问题


i have this code to open the messaging. i wanna add body text into it

            Intent i6 = new Intent(Intent.ACTION_VIEW, Uri
                    .parse("sms:9986377561"));
            startActivity(i6);

add body text

body: test text


回答1:


Intent sendIntent = new Intent(Intent.ACTION_VIEW);
sendIntent.putExtra("sms_body", "The SMS text"); 
sendIntent.putExtra("address", "phoneNumber1;phoneNumber2;...");
sendIntent.setType("vnd.android-dir/mms-sms");
startActivity(sendIntent);


来源:https://stackoverflow.com/questions/4384174/launching-messaging-application-with-a-body-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!