diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2022-01-19 21:04:52 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2022-01-19 23:44:20 +0800 |
commit | 314f309035c9d50b41720e02550f31f89751fce0 (patch) | |
tree | b1b75a65c452c33218cacde385514791bbe03e03 /platform/android/java | |
parent | 8b8e858778bbf9e0dad66335f351920332c547de (diff) |
Add `DisplayServer.clipboard_has()` to check clipboard content
Diffstat (limited to 'platform/android/java')
-rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/Godot.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.java b/platform/android/java/lib/src/org/godotengine/godot/Godot.java index 3fbbd8fbcc..78848c109a 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.java @@ -660,10 +660,14 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC } } + public boolean hasClipboard() { + return mClipboard.hasPrimaryClip(); + } + public String getClipboard() { String copiedText = ""; - if (mClipboard.getPrimaryClip() != null) { + if (mClipboard.hasPrimaryClip()) { ClipData.Item item = mClipboard.getPrimaryClip().getItemAt(0); copiedText = item.getText().toString(); } |