This should fix the ConcurrentModificationException in contacts list
This commit is contained in:
parent
d2e8900480
commit
ccfbf6d5e1
4 changed files with 22 additions and 15 deletions
|
@ -228,7 +228,9 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
@Override
|
||||
public void onContactsUpdated() {
|
||||
ChatListAdapter adapter = (ChatListAdapter)chatList.getAdapter();
|
||||
adapter.notifyDataSetChanged();
|
||||
if (adapter != null) {
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -411,14 +411,16 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
|||
@Override
|
||||
public void onContactsUpdated() {
|
||||
ContactsListAdapter adapter = (ContactsListAdapter)contactsList.getAdapter();
|
||||
contactsList.setFastScrollEnabled(false);
|
||||
if (onlyDisplayLinphoneContacts) {
|
||||
adapter.updateDataSet(ContactsManager.getInstance().getSIPContacts());
|
||||
} else {
|
||||
adapter.updateDataSet(ContactsManager.getInstance().getContacts());
|
||||
if (adapter != null) {
|
||||
contactsList.setFastScrollEnabled(false);
|
||||
if (onlyDisplayLinphoneContacts) {
|
||||
adapter.updateDataSet(ContactsManager.getInstance().getSIPContacts());
|
||||
} else {
|
||||
adapter.updateDataSet(ContactsManager.getInstance().getContacts());
|
||||
}
|
||||
contactsList.setFastScrollEnabled(true);
|
||||
contactsFetchInProgress.setVisibility(View.GONE);
|
||||
}
|
||||
contactsList.setFastScrollEnabled(true);
|
||||
contactsFetchInProgress.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
|
|
|
@ -136,7 +136,6 @@ public class ContactsManager extends ContentObserver {
|
|||
}
|
||||
|
||||
public synchronized List<LinphoneContact> getSIPContacts() {
|
||||
setContacts(contacts);
|
||||
return sipContacts;
|
||||
}
|
||||
|
||||
|
@ -411,11 +410,13 @@ public class ContactsManager extends ContentObserver {
|
|||
return contacts;
|
||||
}
|
||||
|
||||
protected synchronized void onProgressUpdate(List<LinphoneContact>... result) {
|
||||
setContacts(result[0]);
|
||||
contactsCache.clear();
|
||||
for (ContactsUpdatedListener listener : contactsUpdatedListeners) {
|
||||
listener.onContactsUpdated();
|
||||
protected void onProgressUpdate(List<LinphoneContact>... result) {
|
||||
synchronized (ContactsManager.this) {
|
||||
setContacts(result[0]);
|
||||
contactsCache.clear();
|
||||
for (ContactsUpdatedListener listener : contactsUpdatedListeners) {
|
||||
listener.onContactsUpdated();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -222,7 +222,9 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
@Override
|
||||
public void onContactsUpdated() {
|
||||
CallHistoryAdapter adapter = (CallHistoryAdapter)historyList.getAdapter();
|
||||
adapter.notifyDataSetChanged();
|
||||
if (adapter != null) {
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue