Handle case if directory does not exist in FilePicker

Fixes #4
This commit is contained in:
Jonas Kalderstam 2014-04-02 12:17:44 +02:00
parent 5a0aed18ff
commit a17d6552d7
2 changed files with 7 additions and 2 deletions

View File

@ -17,8 +17,8 @@
# Project-wide Gradle settings.
VERSION_NAME=1.1.2-SNAPSHOT
VERSION_CODE=4
VERSION_NAME=1.1.3-SNAPSHOT
VERSION_CODE=5
GROUP=com.nononsenseapps
POM_DESCRIPTION=An extendable Android file/directory-picker you can include in your app

View File

@ -155,6 +155,11 @@ public class FilePickerFragment extends AbstractFilePickerFragment<File> {
protected void onStartLoading() {
super.onStartLoading();
// handle if directory does not exist. Fall back to root.
if (currentPath == null || !currentPath.isDirectory()) {
currentPath = getRoot();
}
// Start watching for changes
fileObserver = new FileObserver(currentPath.getPath(),
FileObserver.CREATE |