diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java b/src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java index d7e2ca347..d22db8fa9 100644 --- a/src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java +++ b/src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java @@ -55,7 +55,10 @@ public class EditMessageActionModeCallback implements ActionMode.Callback { MenuInflater inflater = mode.getMenuInflater(); inflater.inflate(R.menu.edit_message_actions, menu); MenuItem pasteAsQuote = menu.findItem(R.id.paste_as_quote); - pasteAsQuote.setVisible(clipboardManager.hasPrimaryClip() && clipboardManager.getPrimaryClipDescription().hasMimeType("text/plain")); + ClipData primaryClip = clipboardManager.getPrimaryClip(); + if (primaryClip != null && primaryClip.getItemCount() >= 0) { + pasteAsQuote.setVisible(primaryClip.getDescription().getMimeType(0).startsWith("text/") && primaryClip.getItemAt(0).getText() != null); + } return true; } |