在Android中显示撰写短信视图 [英] Show compose SMS view in Android
本文介绍了在Android中显示撰写短信视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用Android发送短信.
I want to send a sms with Android.
发送短信的目的是什么?
What is the intent for SMS sending?
我想在邮件字段中显示预定义的文本,以显示撰写短信视图.
I want to show the compose sms view with my pre-define text passing over in message field.
推荐答案
您可以使用以下代码:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("sms:"
+ phoneNumber)));
确保将phoneNumber
设置为要将邮件发送到的电话号码
Make sure you set phoneNumber
to the phone number that you want to send the message to
您可以使用(从注释中)向SMS添加消息:
You can add a message to the SMS with (from comments):
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:" + phoneNumber));
intent.putExtra("sms_body", message);
startActivity(intent);
这篇关于在Android中显示撰写短信视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文