Добавление файла в качестве вложения в Gmail - PullRequest
0 голосов
/ 29 марта 2019

Когда я добавляю файл в качестве вложения в gmail, я не вижу свои файлы, только сообщение «один из файлов имеет размер более 20 МБ», но я проверил и мне нужно файлы json и изображение, json имеет размер менее 1 КБ и размер изображения не превышает 600 КБ.

Я проверил, и у меня нет возможности сжать больше файлов и не вижу причины, по которой мне нужно это сделать.

Intent sharingIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);
        sharingIntent.setType("vnd.android.cursor.dir/email");

        Uri jsonPath = Uri.fromFile(json);
        Uri screenshotPath = Uri.fromFile(image);
        ArrayList<Uri> uris = new ArrayList<>();
        uris.add(json);
        uris.add(image);
        StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
        StrictMode.setVmPolicy(builder.build());
        sharingIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
        sharingIntent.putExtra(Intent.EXTRA_SUBJECT, "Please entry the subject");
        sharingIntent.putExtra(Intent.EXTRA_TEXT, "Please entry the content of email");
        startActivity(Intent.createChooser(sharingIntent, "Choose direct application"));

Я хотел бы включить эти файлы:)

1 Ответ

0 голосов
/ 31 марта 2019

Хорошо, у меня есть ответ.

fileIn.setReadable (true, false)

...