如果你有发送彩信的任何图片然后使用此代码。
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setClassName("com.android.mms",
"com.android.mms.ui.ComposeMessageActivity");
sendIntent.putExtra("sms_body", "some text");
sendIntent.putExtra(Intent.EXTRA_STREAM,
Uri.parse("file:///sdcard/image_4.png"));
sendIntent.setType("image/png");
startActivity(sendIntent);;
OR
如果你有与音频或视频发送彩信文件,然后用这个。
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setClassName("com.android.mms",
"com.android.mms.ui.ComposeMessageActivity");
sendIntent.putExtra("address", "1213123123");
sendIntent.putExtra("sms_body", "if you are sending text");
final File file1 = new File(mFileName);
if(file1.exists()){
System.out.println("file is exist");
}
Uri uri = Uri.fromFile(file1);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("video/*");
startActivity(sendIntent);
让我知道这是否有助于你。