Enable native file picker support on Android 9 and older

This commit is contained in:
Anish Kumar
2026-01-22 16:44:21 +05:30
parent e0b046e6db
commit c7e5caa68e
3 changed files with 5 additions and 9 deletions

View File

@@ -790,10 +790,8 @@ class Godot private constructor(val context: Context) {
for (plugin in pluginRegistry.allPlugins) {
plugin.onMainActivityResult(requestCode, resultCode, data)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
runOnRenderThread {
FilePicker.handleActivityResult(context, requestCode, resultCode, data)
}
runOnRenderThread {
FilePicker.handleActivityResult(context, requestCode, resultCode, data)
}
}
@@ -1041,9 +1039,7 @@ class Godot private constructor(val context: Context) {
@Keep
private fun showFilePicker(currentDirectory: String, filename: String, fileMode: Int, filters: Array<String>) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
FilePicker.showFilePicker(context, getActivity(), currentDirectory, filename, fileMode, filters)
}
FilePicker.showFilePicker(context, getActivity(), currentDirectory, filename, fileMode, filters)
}
/**