make filtered list item activity survive roations
This commit is contained in:
parent
ccb47c5727
commit
0f39ad0f04
|
@ -112,8 +112,13 @@ public abstract class AbstractSearchableListItemActivity extends XmppActivity {
|
|||
}
|
||||
|
||||
protected void filterContacts() {
|
||||
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);
|
||||
|
||||
|
|
|
@ -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()) {
|
||||
|
@ -230,7 +234,6 @@ public class ChooseContactActivity extends AbstractSearchableListItemActivity {
|
|||
@Override
|
||||
void onBackendConnected() {
|
||||
filterContacts();
|
||||
|
||||
this.mActivatedAccounts.clear();
|
||||
for (Account account : xmppConnectionService.getAccounts()) {
|
||||
if (account.getStatus() != Account.State.DISABLED) {
|
||||
|
|
Loading…
Reference in a new issue