Open teotigraphix opened 1 year ago
AndroidFileSystemRequestAccessCommand
var f:AndroidFile = new AndroidFile("/Internal storage/Documents");
f.addEventListener(PermissionEvent.PERMISSION_STATUS, function (e:PermissionEvent):void {
trace("PERMISSION -> " + e.status + " -> " + f.contentUri);
var listing:Array = f.getDirectoryListing();
trace(listing);
});
f.requestPermission2();
Crashes on f.getDirectoryListing()
.
[trace] PERMISSION -> granted -> content://com.android.externalstorage.documents/tree/primary%3ADocuments
[Fault] exception, information=Error: Error #2037: Functions called in incorrect sequence, or earlier call was unsuccessful.
https://developer.android.com/training/data-storage/shared/documents-files#grant-access-directory