Skip to content

fix(android): return correct path when saving a file#1

Draft
google-labs-jules[bot] wants to merge 1 commit intomasterfrom
fix-android-savefile-path
Draft

fix(android): return correct path when saving a file#1
google-labs-jules[bot] wants to merge 1 commit intomasterfrom
fix-android-savefile-path

Conversation

@google-labs-jules
Copy link

On Android, the saveFile method was returning a path to the Download folder regardless of the directory picked by the user. This was because uri.getPath() was used to get the path from the content URI, which does not always return a real file system path. This commit fixes the issue by adding a new getPath utility function that correctly resolves the absolute file path from the content Uri returned by the native file picker.

The `saveFile` method on Android was returning a path to the `Download` folder regardless of the directory picked by the user.

This was because `uri.getPath()` was used to get the path from the content URI, which does not always return a real file system path.

This commit fixes the issue by adding a new `getPath` utility function that correctly resolves the absolute file path from the content `Uri` returned by the native file picker.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants