【发布时间】:2013-05-03 19:15:21
【问题描述】:
我正在尝试创建一个 Intent,它将为我启动 MMS 应用程序,并附加一个图像文件和一些预定义的文本出现在消息正文中。
到目前为止,我已经能够完成其中一个或,但不能同时完成。
我尝试过的事情(及其结果):
sendIntent = new Intent(android.content.Intent.ACTION_SEND,Uri.parse("mms://"));
sendIntent.setType("image/gif");
sendIntent.putExtra(Intent.EXTRA_STREAM, imgStreamUri);
sendIntent.putExtra("sms_body", "HelloWorld");
startActivity(Intent.createChooser(sendIntent,"Send"));
/**********
Image file is attached but no text added to message body.
**********/
sendIntent = new Intent(android.content.Intent.ACTION_SEND);
sendIntent.setType("image/gif");
sendIntent.putExtra(Intent.EXTRA_STREAM, imgStreamUri);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "HelloWorld");
sendIntent.putExtra(Intent.EXTRA_TITLE, "WorldHello");
startActivity(Intent.createChooser(sendIntent,"Send"));
/**********
Image file is attached but no text added to message body(or subject or anything).
**********/
有谁知道我如何将正文和图像文件附加到一个 mms 意图中,该意图将启动默认消息传递应用程序并填写适当的项目?
编辑: 测试了@lenik 在答案中提供的代码。它正在某些设备上运行,这是我发现的
正常工作:
- 史诗4g(银河S)
- Epic 4g Touch (Galaxy S II)
- Galaxy Nexus(ICS 4.0.4)
- HTC Desire (Froyo 2.2)
- 摩托罗拉光子
附图但无文字:
- Sidekick 4g
- 三星 Transform Ultra
任何人都知道我是否基本上是 s.o.l.在不能以这种方式正常工作的设备上?
【问题讨论】:
标签: android android-intent message mms