From 9c67e8fec25e851802d60406f44671e2261b8557 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 8 Dec 2020 07:10:54 +0100 Subject: [PATCH] fix long pressing on a textview with link --- .../java/eu/siacs/conversations/ui/ConversationFragment.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 07e35a50e..8bbd804a9 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1075,6 +1075,8 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { + //This should cancel any remaining click events that would otherwise trigger links + v.dispatchTouchEvent(MotionEvent.obtain(0, 0, MotionEvent.ACTION_CANCEL, 0f, 0f, 0)); synchronized (this.messageList) { super.onCreateContextMenu(menu, v, menuInfo); AdapterView.AdapterContextMenuInfo acmi = (AdapterContextMenuInfo) menuInfo;