mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-03 13:14:46 +00:00
workaround for bad implementation of ClipboardManager, #203
This commit is contained in:
parent
56906775e9
commit
67d4f53e73
1 changed files with 6 additions and 1 deletions
|
@ -12,7 +12,12 @@ public class ClipboardManagerCompat {
|
|||
@TargetApi(Build.VERSION_CODES.P)
|
||||
public static void clearPrimaryClip(ClipboardManager cm) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
try {
|
||||
cm.clearPrimaryClip();
|
||||
} catch (Exception e) {
|
||||
// workaround for system-caused crash in https://github.com/Helium314/openboard/issues/203
|
||||
cm.setPrimaryClip(ClipData.newPlainText("", ""));
|
||||
}
|
||||
} else {
|
||||
cm.setPrimaryClip(ClipData.newPlainText("", ""));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue