From a5de5060a92957b3f2ef6890e3784b5b684b886b Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 10 Mar 2014 21:52:58 +0100 Subject: another possible fix for notificationgate --- src/eu/siacs/conversations/ui/ConversationActivity.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/eu/siacs/conversations/ui/ConversationActivity.java') diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java index 02d784273..ced860daf 100644 --- a/src/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/eu/siacs/conversations/ui/ConversationActivity.java @@ -407,9 +407,8 @@ public class ConversationActivity extends XmppActivity { public void onStart() { super.onStart(); - if (xmppConnectionServiceBound) { - xmppConnectionService.setOnConversationListChangedListener(this.onConvChanged); - } + this.registerListener(); + xmppConnectionService.setOnConversationListChangedListener(this.onConvChanged); if (conversationList.size()>=1) { onConvChanged.onConversationListChanged(); } @@ -427,8 +426,7 @@ public class ConversationActivity extends XmppActivity { @Override void onBackendConnected() { - xmppConnectionService.setOnConversationListChangedListener(this.onConvChanged); - + this.registerListener(); if (conversationList.size()==0) { conversationList.addAll(xmppConnectionService .getConversations()); @@ -472,7 +470,13 @@ public class ConversationActivity extends XmppActivity { } } } - @Override + public void registerListener() { + if (xmppConnectionServiceBound) { + xmppConnectionService.setOnConversationListChangedListener(this.onConvChanged); + } + } + + @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { -- cgit v1.2.3