From 195920e4763d138561b243b74ff554313360f75b Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 28 Sep 2024 23:25:28 -0400 Subject: [PATCH] android: Avoid a ClosedWatchServiceException. --- .../com/unprompted/tildefriends/TildeFriendsActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/android/com/unprompted/tildefriends/TildeFriendsActivity.java b/src/android/com/unprompted/tildefriends/TildeFriendsActivity.java index 90bfab61..160a1da2 100644 --- a/src/android/com/unprompted/tildefriends/TildeFriendsActivity.java +++ b/src/android/com/unprompted/tildefriends/TildeFriendsActivity.java @@ -99,7 +99,8 @@ public class TildeFriendsActivity extends Activity { @Override public void run() { Log.w("tildefriends", "Watching for changes in: " + getFilesDir().toString()); - try (WatchService watcher = FileSystems.getDefault().newWatchService()) { + try { + WatchService watcher = FileSystems.getDefault().newWatchService(); Paths.get(getFilesDir().toString()).register( watcher, StandardWatchEventKinds.ENTRY_CREATE,