Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.putExtra("address", "12134567899");
intent.putExtra("sms_body", "See attached picture");
intent.putExtra(Intent.EXTRA_STREAM,
Uri.parse("file:///sdcard/DCIM/Camera/2011-09-09 12.47.29.jpg"));
intent.setType("image/png");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
我尝试这样的代码。 如果意图启动彩信撰写UI即将到来,我该如何克服并自动发送
首先,祝你好运。由于安卓 SDK 不支持彩信,因此您有 2 个选项:
-
下载安卓彩信应用程序,并尝试了解那里发生了什么。
-
点击此链接:http://androidbridge.blogspot.com/2011/03/how-to-send-mms-programmatically-in.html
我目前发现的唯一工作...
此功能是作为Android中的安全功能设计的,请不要尝试绕过它。它的存在是有原因的。
如果您绝对必须,您是否尝试过在 root 设备上运行它?它允许更大的访问。
试试这个它对我有用.用 Uri.fromFile而不是 Uri.parse
File f=new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/DCIM/Camera/"+img_name);
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra("", "");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(f));
sendIntent.setType("image/png");
startActivity(sendIntent);