diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 8ec813ae2..a044b4dca 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -443,24 +443,26 @@ public class ConversationActivity extends XmppActivity } } if (Config.supportOmemo()) { - new Handler().post(new Runnable() { - @Override - public void run() { - View view = findViewById(R.id.action_security); - if (view != null) { - view.setOnLongClickListener(new View.OnLongClickListener() { - @Override - public boolean onLongClick(View v) { - return quickOmemoDebugger(getSelectedConversation()); - } - }); - } - } - }); + new Handler().post(addOmemoDebuggerRunnable); } return super.onCreateOptionsMenu(menu); } + private Runnable addOmemoDebuggerRunnable = new Runnable() { + @Override + public void run() { + View view = findViewById(R.id.action_security); + if (view != null) { + view.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + return v.getId() == R.id.action_security && quickOmemoDebugger(getSelectedConversation()); + } + }); + } + } + }; + private boolean quickOmemoDebugger(Conversation c) { if (c != null) { boolean single = c.getMode() == Conversation.MODE_SINGLE;