Share file in Android 9

I have this application that creates a csv file and I need to share it. This works perfectly on android 10, 11...
But it doesn't work with android 9 as I get the following error.

How can I fix this?
Thanks in advance for the help

These are my blocks

you share the file for Android 10+ from the ASD... why don't you do the same for Android <10?
you try to share the file for Android < 10 from the root directory...
where do you store the file for Android < 10? let me suggest you to store the file always in the ASD...

This has nothing to do with Sharing, but with the File / EFile component. You must request WRITE permission on Android < 10 to save the text file in the external storage outside of the ASD.

So do this or better follow Taifun's advice, then no storage permissions are needed on Android 4.4 and higher (API 19+).

thank you both, it worked!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.