Skip to content

Commit

Permalink
Merge pull request #96 from RobertOdrowaz/fix/save-as-location-selection
Browse files Browse the repository at this point in the history
Remove unnecessary create document intent parameters
  • Loading branch information
incrediblezayed authored Feb 18, 2024
2 parents ab84014 + 4f187ab commit ba4ff43
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
All notable changes to this project will be documented in this file.

## [0.2.10]
* Fixed ([GitHub issue #95](https://github.com/incrediblezayed/file_saver/issues/95))
* Fixed ([GitHub issue #92](https://github.com/incrediblezayed/file_saver/issues/92))

## [0.2.9]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,13 @@ class Dialog(private val activity: Activity) : PluginRegistry.ActivityResultList
this.fileName = fileName
val intent =
Intent(Intent.ACTION_CREATE_DOCUMENT)
intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true)
intent.addCategory(Intent.CATEGORY_OPENABLE)
intent.putExtra(Intent.EXTRA_TITLE, "$fileName.$ext")
intent.putExtra(Intent.EXTRA_MIME_TYPES, type)
intent.putExtra(
DocumentsContract.EXTRA_INITIAL_URI,
Environment.getExternalStorageDirectory().path
)
intent.type = type
intent.flags = (Intent.FLAG_GRANT_READ_URI_PERMISSION
or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
or Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION
or Intent.FLAG_GRANT_PREFIX_URI_PERMISSION
)
activity.startActivityForResult(intent, SAVE_FILE)
}

Expand Down

0 comments on commit ba4ff43

Please sign in to comment.