FileRequest() Not Working on Android

Discuss any general programming issues here
Post Reply
PEB
Posts: 588
Joined: Sun Feb 21, 2010 1:28 am

FileRequest() Not Working on Android

Post by PEB »

Using the new Hollywood Player (11) for Android, the new file requester looks great! However, I get the following error no matter what file I select:
Error locking content://com.android.providers.media.documents/document!
User avatar
airsoftsoftwair
Posts: 5887
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: FileRequest() Not Working on Android

Post by airsoftsoftwair »

Does this really happen in FileRequest() or are you trying to do something with the file returned by FileRequest()? Keep in mind that FileRequest() now operates using Android's Scoped Access Framework (SAF) which means that the returned file specifications will be different from "normal" files because they can also point to files in the cloud etc. See here for more information on how to deal with those content URIs.
PEB
Posts: 588
Joined: Sun Feb 21, 2010 1:28 am

Re: FileRequest() Not Working on Android

Post by PEB »

This is my code:

Code: Select all

f$=FileRequest("Select File")
NPrint(f$)
The error is reported "In function: FileRequest"
User avatar
airsoftsoftwair
Posts: 5887
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: FileRequest() Not Working on Android

Post by airsoftsoftwair »

PEB wrote: Sun Feb 01, 2026 1:29 am This is my code:

Code: Select all

f$=FileRequest("Select File")
NPrint(f$)
The error is reported "In function: FileRequest"
So the file requester pops up and you are able to select a file and after you have selected a file you get the "error locking ..." error? What Android version is that?
PEB
Posts: 588
Joined: Sun Feb 21, 2010 1:28 am

Re: FileRequest() Not Working on Android

Post by PEB »

Yes, that's exactly what happens.
I'm using Android version 16 on a "OnePlus 13".
User avatar
airsoftsoftwair
Posts: 5887
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: FileRequest() Not Working on Android

Post by airsoftsoftwair »

Hmm... does PathRequest() show the same behaviour or does that work?
PEB
Posts: 588
Joined: Sun Feb 21, 2010 1:28 am

Re: FileRequest() Not Working on Android

Post by PEB »

Yes, PathRequest() works fine.
And that also has allowed FileRequest() to work properly now too.

So this is what happened:
Using PathRequest(), I selected the desired folder, which caused a permission requester to appear. Once permission was granted, the path was returned to Hollywood as expected.

Previously, when I was testing FileRequest(), there was no permission sought or granted. So apparently that was the problem. But now that permission has been granted---using PathRequest()---I can also use FileRequest() without problems.

Thanks for pointing me to a fix for my problem. That might have been something that was spelled out in the documentation, but I hadn't seen it.
Post Reply