From 6712ca657d47ab95cdd4cd561e4bd6d0c17f4d5c Mon Sep 17 00:00:00 2001 From: Catfriend1 Date: Thu, 25 Oct 2018 16:20:23 +0200 Subject: [PATCH] Fallback to built-in path selector (fixes #111) (#112) * Fallback to built-in path selector (fixes #111) * Update APK version to 0.14.51.11 / 4174 --- app/build.gradle | 4 ++-- .../syncthingandroid/activities/FolderActivity.java | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e74e27bb..747ac4ac 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -36,8 +36,8 @@ android { applicationId "com.github.catfriend1.syncthingandroid" minSdkVersion 16 targetSdkVersion 26 - versionCode 4173 - versionName "0.14.51.10" + versionCode 4174 + versionName "0.14.51.11" testApplicationId 'com.github.catfriend1.syncthingandroid.test' testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' playAccountConfig = playAccountConfigs.defaultAccountConfig diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderActivity.java index c101b613..8946b72e 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderActivity.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/FolderActivity.java @@ -257,7 +257,13 @@ public class FolderActivity extends SyncthingActivity } intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true); intent.putExtra("android.content.extra.SHOW_ADVANCED", true); - startActivityForResult(intent, CHOOSE_FOLDER_REQUEST); + try { + startActivityForResult(intent, CHOOSE_FOLDER_REQUEST); + } catch (android.content.ActivityNotFoundException e) { + Log.e(TAG, "onPathViewClick exception, falling back to built-in FolderPickerActivity.", e); + startActivityForResult(FolderPickerActivity.createIntent(this, mFolder.path, null), + FolderPickerActivity.DIRECTORY_REQUEST_CODE); + } } /**