Thank you Taifun,
I tried converting the uri to a file path with your extension and it didn't work, but it did work with Filetools as you told me.
Also reducing the blocks will work fine for me, just testing now, to see the label I put it like this.
Still, I can't get the pdfs to open with SAF. Maybe it's because of what @vknow360 was saying earlier. I don't know.
I am attaching the blocks for anyone if anyone sees any errors in them.
There is some misunderstanding, I guess.
You can't open any kind of file with SAF, you can only get access to files and read and write them.
Obviously you can render pdf files with Uri obtained from SAF with the help of extensions available in your own app.
I understand, I had been told that the problem of not being able to open pdfs was because of android 11 read/write permissions, and I thought that with SAF I could access this type of files with read permissions in this case.
@vknow360 not exactly, what I was telling Taifun is that when I select the pdf file with SAF and get the Uri, I put it in the DataUri of ActivityStarter and it did not open the file. Then he suggested me to try to convert it to a normal path like file:///storage/emulated/0/... with its extension or with Filetools. And getting the path didn't work with TaifunFile and Filetools did (only the Uri to path), but even putting this path in the activitystarter DataUri still doesn't open pdfs (with android 11, this same thing on my tablet with android 8 opens pdfs without problems).
This only works because the PDF file is created (downloaded) by the app itself.
If the file has already been manually saved in this folder (/Download) by yourself or by another app, this will not work.
Correct @Anke
I am also searching solution for opening a pdf file already stored in Documents folder.
Can the possible solution be -
to copy this file to ASD by using SAF extention by @vknow360 and then try opening it from ASD.?
Thank you @Clipper for the solution you share. I have tried it and it works!
but in my case I need to open pdfs that are in the internal storage of the mobile.
This is a folder in the external storage (and also one of the Shared folders).
To open / access non-media files, that are not created by the app itself, from the external storage (or even from a Shared folder) you need SAF.