From c43457fc68b86a099e4000ac135694014d526ba5 Mon Sep 17 00:00:00 2001 From: y20k Date: Mon, 16 Dec 2019 21:29:27 +0100 Subject: [PATCH] prevents a crash on older devices --- app/src/main/java/org/y20k/escapepod/PodcastPlayerActivity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/y20k/escapepod/PodcastPlayerActivity.kt b/app/src/main/java/org/y20k/escapepod/PodcastPlayerActivity.kt index a034b41e..cc773812 100644 --- a/app/src/main/java/org/y20k/escapepod/PodcastPlayerActivity.kt +++ b/app/src/main/java/org/y20k/escapepod/PodcastPlayerActivity.kt @@ -806,8 +806,8 @@ class PodcastPlayerActivity: AppCompatActivity(), CoroutineScope, var fileObserver: FileObserver? = null // check if valid folder if (folder != null && folder.isDirectory) { - // create the observer - fileObserver = object: FileObserver(folder, CREATE) { + // create the observer - Note: constructor is deprecated, but the one that it replaces is API 29+ + fileObserver = object: FileObserver(folder.path, CREATE) { override fun onEvent(event: Int, path: String?) { // a file file was created in the collection folder tryToOfferOpmlImport()