aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/ui/AbstractSearchableListItemActivity.java7
-rw-r--r--src/main/java/de/pixart/messenger/ui/ChooseContactActivity.java4
2 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/AbstractSearchableListItemActivity.java b/src/main/java/de/pixart/messenger/ui/AbstractSearchableListItemActivity.java
index 768e738ba..df0708f7e 100644
--- a/src/main/java/de/pixart/messenger/ui/AbstractSearchableListItemActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/AbstractSearchableListItemActivity.java
@@ -112,7 +112,12 @@ public abstract class AbstractSearchableListItemActivity extends XmppActivity {
}
protected void filterContacts() {
- filterContacts(null);
+ final String needle = mSearchEditText != null ? mSearchEditText.getText().toString() : null;
+ if (needle != null && !needle.isEmpty()) {
+ filterContacts(needle);
+ } else {
+ filterContacts(null);
+ }
}
protected abstract void filterContacts(final String needle);
diff --git a/src/main/java/de/pixart/messenger/ui/ChooseContactActivity.java b/src/main/java/de/pixart/messenger/ui/ChooseContactActivity.java
index 86f7902c9..9d51a1c1d 100644
--- a/src/main/java/de/pixart/messenger/ui/ChooseContactActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ChooseContactActivity.java
@@ -161,6 +161,10 @@ public class ChooseContactActivity extends AbstractSearchableListItemActivity {
protected void filterContacts(final String needle) {
getListItems().clear();
+ if (xmppConnectionService == null) {
+ getListItemAdapter().notifyDataSetChanged();
+ return;
+ }
for (final Account account : xmppConnectionService.getAccounts()) {
if (account.getStatus() != Account.State.DISABLED) {
for (final Contact contact : account.getRoster().getContacts()) {