diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-11-11 17:39:28 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-11-11 17:39:28 +0100 |
commit | e555fe4b033d2ad342d757217bb59704ad8207f9 (patch) | |
tree | cbf60098417417f80fa40b24ad054c6788078211 /src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | |
parent | fce78abb1cf985ac02af1c997ff8871f47ce97af (diff) |
auto register/unregister listeners
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 8cb8a3aab..5d11bb597 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -634,18 +634,6 @@ public class ConversationActivity extends XmppActivity implements } @Override - protected void onStop() { - if (xmppConnectionServiceBound) { - xmppConnectionService.removeOnConversationListChangedListener(); - xmppConnectionService.removeOnAccountListChangedListener(); - xmppConnectionService.removeOnRosterUpdateListener(); - xmppConnectionService.getNotificationService().setOpenConversation( - null); - } - super.onStop(); - } - - @Override public void onSaveInstanceState(final Bundle savedInstanceState) { Conversation conversation = getSelectedConversation(); if (conversation != null) { @@ -662,9 +650,7 @@ public class ConversationActivity extends XmppActivity implements @Override void onBackendConnected() { - this.registerListener(); updateConversationList(); - if (xmppConnectionService.getAccounts().size() == 0) { startActivity(new Intent(this, EditAccountActivity.class)); } else if (conversationList.size() <= 0) { @@ -722,10 +708,10 @@ public class ConversationActivity extends XmppActivity implements } } - public void registerListener() { - xmppConnectionService.setOnConversationListChangedListener(this); - xmppConnectionService.setOnAccountListChangedListener(this); - xmppConnectionService.setOnRosterUpdateListener(this); + @Override + protected void unregisterListeners() { + super.unregisterListeners(); + xmppConnectionService.getNotificationService().setOpenConversation(null); } @Override |