Skip to content
Advertisement

Android 11: Send e-mail with automatically attached file

I want open and email app with already generated text, subject, recipient and attached file, it works with android sdk version 29 (android 10) and lower. However starting Android 11 there are restriction to writing file in external or internal storages, and there is also another restriction that is not allowed to attach file automatically from app file directory. Previously I was copying from app storage to internal or external storage to attach file, any solutions?

done android:requestLegacyExternalStorage="true"

JavaScript
JavaScript

Advertisement

Answer

I have done using FileProvider and selector, this is for multiple files

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement