将开发过程中经常用到的一些代码段记录起来,如下资料是关于Android发送短信的的代码。
String body=”this is mms demo”;
Intent mmsintent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(”smsto”, number, null));
mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);
mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, true);
mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, true);
startActivity(mmsintent);
本文提供了一段用于在Android应用程序中发送短信的代码示例。通过使用Intent和Uri组件,开发者可以轻松地调用系统的短信功能,实现短信的发送。代码详细展示了如何设置短信内容和收件人,并启动发送过程。
142

被折叠的 条评论
为什么被折叠?



