如何在Android 4.0+中发送带有附件的mms?我试着:
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("image/png");
sendIntent.putExtra(Intent.EXTRA_STREAM,
Uri.parse(outputFile.toURL().toString()));
startActivity(sendIntent);
它在htc和三星中运行良好,但在Nexus 5(常去的地方)中不起作用。我试着:
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra("address", phonesBuilder2.toString());
sendIntent.putExtra("sms_body", editTextTPMessage.getText());
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(makePicture()));
但文件未附加。我尝试了很多方法,但所有方法都有问题。
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra("sms_body", "Hi how are you"); //Version dependent
intent.putExtra(Intent.EXTRA_TEXT, "Hi how are you"); //Version dependent
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File("/sdcard/file.gif")));
intent.setType("image/gif");
startActivity(Intent.createChooser(intent,"Send"));