try {
Intent mmsIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);
ArrayList<Uri> files = new ArrayList<>();
for (int i = 0; i < currentPhotoPaths.size(); i++) {
if (!Strings.isNullOrEmpty(currentPhotoPaths.get(i))) {
File imageFile = new File(currentPhotoPaths.get(i));
Uri uri = FProvider.getUriForFile(TourneeEnCoursActivity.this, String.format("%s.fprovider", TourneeEnCoursActivity.this.getApplicationContext().getPackageName()), imageFile);
files.add(uri);
}
}
mmsIntent.putExtra(Intent.EXTRA_TEXT, "body");
mmsIntent.putExtra("address", "0101010101");
mmsIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, files);
mmsIntent.setType("image/*");
startActivity(mmsIntent);
} catch (Exception e) {
Log.d(TAG, "Error occurred while creating the File for the photo", e);
mmsIntent.putExtra(Intent.EXTRA_STREAM, new ArrayList<>());
}
我想打开 Android 消息应用程序并直接与指定地址(收件人)进行对话,但不幸的是,我得到以下弹出窗口来选择收件人:
知道如何将接收者设置为意图参数并直接获取 MMS/SMS 对话吗?
PS:mmsIntent.setData(Uri.parse("smsto:" + configurationParMaitrise.getMaitrise().getTel())); 也不行。