From 1420ccc1be7c451670c00e799f13262e11ed1303 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 31 Oct 2016 09:19:37 +0900 Subject: [PATCH] Fixed crash in folder picker on pre-Kitkat devices (fixes #772) --- .../syncthingandroid/activities/FolderPickerActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java b/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java index 709a9ed3..e8dfb309 100644 --- a/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java @@ -104,7 +104,9 @@ public class FolderPickerActivity extends SyncthingActivity roots.add(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)); roots.add(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)); roots.add(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)); - roots.add(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + roots.add(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)); + } // Add paths that might not be accessible to Syncthing. SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);