3

I am using the aFileChooser library to let my user choose file. This library is good because it works with pre Kitkat and post Kitkat ( they changed how you can get the path for files/folders). In addition it shows internal and external.

The problem that I can only let the person choose files. I want the user to also be able to choose folders only ( not files) and I can't seem to know how to do that or modify the code to do it.

Any help?

Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
Snake
  • 14,228
  • 27
  • 117
  • 250
  • How do you want to differentiate between selecting a directory to change to, and selecting a directory to return as the result? – Mike M. Jul 31 '14 at 03:06
  • One possibility would be that every directory has an item (like a file) called "use directory" so it will use the path you are in. – Snake Jul 31 '14 at 03:08
  • Another option would be to have an OK button once you are in there – Snake Jul 31 '14 at 03:08
  • I think the simplest solution would be to set an `OnItemLongClickListener` on the ListView, add an `onDirSelected()` method to the `FileListFragment.Callbacks` interface, and call that in `onItemLongClick()` if the File `isDirectory()`. Other than that, it'd be a little more refactoring than I'd want to do. – Mike M. Jul 31 '14 at 03:46
  • The think is I dont think that code is always called. I tried stepping through the code and it seems the code is not called (maybe cause I have kitkat running) and the "localStorage" code is being called instead – Snake Jul 31 '14 at 03:56
  • Ah, it might be. I just glanced over the ListFragment code on github. – Mike M. Jul 31 '14 at 03:59

0 Answers0