public static void clearClipboard() {
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) {
            ((ClipboardManager) CgeoApplication.getInstance().getSystemService(Context.CLIPBOARD_SERVICE)).clearPrimaryClip();
        } else {
            copyToClipboard("");
        }
    }
clear clipboard content
(up to API level 28: replace with empty string)
main/src/main/java/cgeo/geocaching/utils/ClipboardUtils.java