Android Question file dialog not working in release mode

catyinwong

Active Member
Licensed User
Longtime User
I have the following code which works well in debug mode, but it cannot show/search any file in release mode. anyone knows how to fix it?

<code>
Dim fd as filedialog
fd.filepath = "storage/emulated/0/documents/"
fd.filefilter = ".xls"

dim sf as object = fd.showasync("choose a file","confirm","","cancel",null,false)

</code>
 

DonManfred

Expert
Licensed User
Longtime User
Use code tags when posting code.

Make sure to use Runtimepermissions and request permission for the path used.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Many mistakes here. Take 20 minutes and watch the video tutorial about runtime permissions. It will save you a lot of time.

1. Click on List Permissions (in the logs tab). You will see that no permission is marked as dangerous permission.
2. Remove this:
B4X:
AddManifestText(<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
)
3. Add this:
B4X:
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
4. Remove Activity_PermissionResult and learn how to use Wait For.
 
Upvote 0
Top