make filtered list item activity survive roations
This commit is contained in:
parent
ccb47c5727
commit
0f39ad0f04
|
@ -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);
|
||||
|
|
|
@ -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 New Issue