aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui/StartConversationActivity.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-07-18 15:35:31 +0200
committeriNPUTmice <daniel@gultsch.de>2014-07-18 15:35:31 +0200
commit4307b1de723a5ec28610580ad04bb7cb327b264c (patch)
tree0493a9df396a565afa903ee74e1334533ac1acf6 /src/eu/siacs/conversations/ui/StartConversationActivity.java
parent6b74c0594e95dcedfdbeeb33ef7bdd8b52c1093e (diff)
notify ui on roster changes
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/ui/StartConversationActivity.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/ui/StartConversationActivity.java b/src/eu/siacs/conversations/ui/StartConversationActivity.java
index 5e22b65f..d12d2878 100644
--- a/src/eu/siacs/conversations/ui/StartConversationActivity.java
+++ b/src/eu/siacs/conversations/ui/StartConversationActivity.java
@@ -40,6 +40,7 @@ import eu.siacs.conversations.entities.Bookmark;
import eu.siacs.conversations.entities.Contact;
import eu.siacs.conversations.entities.Conversation;
import eu.siacs.conversations.entities.ListItem;
+import eu.siacs.conversations.services.XmppConnectionService.OnRosterUpdate;
import eu.siacs.conversations.ui.adapter.KnownHostsAdapter;
import eu.siacs.conversations.ui.adapter.ListItemAdapter;
import eu.siacs.conversations.utils.Validator;
@@ -139,6 +140,19 @@ public class StartConversationActivity extends XmppActivity {
int count) {
}
};
+ private OnRosterUpdate onRosterUpdate = new OnRosterUpdate() {
+
+ @Override
+ public void onRosterUpdate() {
+ runOnUiThread(new Runnable() {
+
+ @Override
+ public void run() {
+ filter(mSearchEditText.getText().toString());
+ }
+ });
+ }
+ };
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -200,6 +214,12 @@ public class StartConversationActivity extends XmppActivity {
});
}
+
+ @Override
+ public void onStop() {
+ super.onStop();
+ xmppConnectionService.removeOnRosterUpdateListener();
+ }
protected void openConversationForContact(int position) {
Contact contact = (Contact) contacts.get(position);
@@ -444,6 +464,7 @@ public class StartConversationActivity extends XmppActivity {
@Override
void onBackendConnected() {
+ xmppConnectionService.setOnRosterUpdateListener(this.onRosterUpdate );
if (mSearchEditText != null) {
filter(mSearchEditText.getText().toString());
} else {