This commit is contained in:
J-Jamet
2020-02-20 09:06:11 +01:00
parent be1f68015b
commit cc83a99efe

View File

@@ -98,10 +98,14 @@ class ClipboardHelper(private val context: Context) {
@Throws(ClipboardException::class) @Throws(ClipboardException::class)
fun cleanClipboard(label: String = "") { fun cleanClipboard(label: String = "") {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { try {
getClipboardManager()?.clearPrimaryClip() if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
} else { getClipboardManager()?.clearPrimaryClip()
copyToClipboard(label, "") } else {
copyToClipboard(label, "")
}
} catch (e: Exception) {
throw ClipboardException(e)
} }
} }