diff --git a/modules/util/src/main/native/android/dalvik/Util.java b/modules/util/src/main/native/android/dalvik/Util.java index 8ad5e783..7da5a03e 100644 --- a/modules/util/src/main/native/android/dalvik/Util.java +++ b/modules/util/src/main/native/android/dalvik/Util.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2023, Gluon + * Copyright (c) 2020, 2024, Gluon * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,9 +47,9 @@ public class Util { private static boolean debug = false; public Util(Activity activity) { - Util.activity = activity; Log.v(TAG, "Util "); if (activity != null) { + Util.activity = activity; new Handler(Util.activity.getMainLooper()).postDelayed(new Runnable() { @Override @@ -97,6 +97,9 @@ private static void syncClipboardFromOS() { @Override public void run() { if (Util.activity == null) { + if (debug) { + Log.v(TAG, "Util::syncClipboardFromOS failed, no activity"); + } return; } new Handler(Util.activity.getMainLooper()).postDelayed(new Runnable() { @@ -123,6 +126,9 @@ public void run() { private static void syncClipboardToOS() { if (Util.activity == null) { + if (debug) { + Log.v(TAG, "Util::syncClipboardToOS failed, no activity"); + } return; } final String text = nativeSyncClipboardToOS();