openFilePicker() asks for folders
See original GitHub issueHello! I have this code, which uses storageHelper.openFilePicker()
, and it asks me to open a folder anyway. I can select a folder and can’t click on a file (it doesn’t do anything), just like a folder picker. I guess it’s an android issue?
MainActivity.kt
class ListFilesActivity : AppCompatActivity() {
private lateinit var storageHelper: SimpleStorageHelper
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
storageHelper = SimpleStorageHelper(this, savedInstanceState)
storageHelper.requestStorageAccess()
storageHelper.onFileSelected = { i: Int, documentFile: DocumentFile ->
println(documentFile.name)
}
storageHelper.openFilePicker()
}
override fun onSaveInstanceState(outState: Bundle) {
storageHelper.storage.onSaveInstanceState(outState)
super.onSaveInstanceState(outState)
}
override fun onRestoreInstanceState(savedInstanceState: Bundle) {
super.onRestoreInstanceState(savedInstanceState)
storageHelper.storage.onRestoreInstanceState(savedInstanceState)
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Open files and folders with a picker - UWP - Microsoft Learn
Access files and folders by letting the user interact with a picker. You can use the FileOpenPicker and FileSavePicker classes to gain ...
Read more >Window.showOpenFilePicker() - Web APIs - MDN Web Docs
The showOpenFilePicker() method of the Window interface shows a file picker that allows a user to select a file or multiple files and ......
Read more >UWP how to get access to file in folder - Stack Overflow
FileOpenPicker gives you a StorageFile which wraps the opened files and gives you permission to it. This ...
Read more >How to use FilePicker and FolderPicker in WinUI 3 ... - GitHub
var filePicker = new FileOpenPicker(); // Get the current window's HWND by passing in the Window object var hwnd = WinRT.Interop.WindowNative.
Read more >The File System Access API: simplifying access to local files
When this happens, the browser shows a modal prompt and ask the user to choose a different folder. # Modifying an existing file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It is a known bug on
0.4.4
. The fixes will be on0.5.0
.Yes it works in the Snapshot! Thanks