This commit is contained in:
J-Jamet committed 2020-02-20 09:06:11 +01:00
1 parent be1f68015b
commit cc83a99efe
1 file changed
+8 -4
@@ -98,10 +98,14 @@ class ClipboardHelper(private val context: Context) {
@Throws(ClipboardException::class)
fun cleanClipboard(label: String = "") {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
getClipboardManager()?.clearPrimaryClip()
} else {
copyToClipboard(label, "")
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
getClipboardManager()?.clearPrimaryClip()
} else {
copyToClipboard(label, "")
}
} catch (e: Exception) {
throw ClipboardException(e)
}
}