android - 发送彩信确实包含 "sms_body"

标签 android mms

我正在尝试使用以下代码通过彩信发送图像

Intent sendIntent = new Intent(Intent.ACTION_SEND); 
sendIntent.putExtra("sms_body", "Hi there"); 
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
sendIntent.setType("image/png"); 

它打开消息应用程序并附加消息,但它没有写“sms_body”,在我的例子中是“你好”。为什么?

最佳答案

试试这个:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
intent.putExtra("subject", "subject");
intent.putExtra("sms_body", "Hi there");
intent.putExtra("address", "Phonenumber");
intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
intent.setType("image/png");
startActivity(intent);

关于android - 发送彩信确实包含 "sms_body",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11283085/

相关文章:

android - 有没有办法使用 curl 或 wget 从命令行下载彩信?

hyperlink - MMS 中的内部超链接

android - MMS 内容提供商问题(Samsung Galaxy S3)

android - 如何使用 ObjectBox 存储货币值 (BigDecimal)?

android - 字符串.xml : How to remove underlining from the space preceding an <u> tag?

android - 发现多个文件的操作系统独立路径为 'mockito-extensions/org.mockito.plugins.MockMaker'

android - 使用多个 Google Maps API 是否违反 TOS?

android - 从 Android 客户端应用程序登录 AppEngine Web 应用程序

android - 如何以编程方式无意发送彩信

android - 彩信 Intent ACTION_SEND