teotigraphix / TeotiAIRSDK

Issues for AIR app dev SDK
0 stars 0 forks source link

[SDK] Test grant access for directory tree using native Android project #15

Open teotigraphix opened 1 year ago

teotigraphix commented 1 year ago

https://developer.android.com/training/data-storage/shared/documents-files#grant-access-directory

Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
teotigraphix commented 1 year ago
teotigraphix commented 1 year ago
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.