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
|
@Override
|
||||||
public void onContactsUpdated() {
|
public void onContactsUpdated() {
|
||||||
ChatListAdapter adapter = (ChatListAdapter)chatList.getAdapter();
|
ChatListAdapter adapter = (ChatListAdapter)chatList.getAdapter();
|
||||||
adapter.notifyDataSetChanged();
|
if (adapter != null) {
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -411,14 +411,16 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
||||||
@Override
|
@Override
|
||||||
public void onContactsUpdated() {
|
public void onContactsUpdated() {
|
||||||
ContactsListAdapter adapter = (ContactsListAdapter)contactsList.getAdapter();
|
ContactsListAdapter adapter = (ContactsListAdapter)contactsList.getAdapter();
|
||||||
contactsList.setFastScrollEnabled(false);
|
if (adapter != null) {
|
||||||
if (onlyDisplayLinphoneContacts) {
|
contactsList.setFastScrollEnabled(false);
|
||||||
adapter.updateDataSet(ContactsManager.getInstance().getSIPContacts());
|
if (onlyDisplayLinphoneContacts) {
|
||||||
} else {
|
adapter.updateDataSet(ContactsManager.getInstance().getSIPContacts());
|
||||||
adapter.updateDataSet(ContactsManager.getInstance().getContacts());
|
} else {
|
||||||
|
adapter.updateDataSet(ContactsManager.getInstance().getContacts());
|
||||||
|
}
|
||||||
|
contactsList.setFastScrollEnabled(true);
|
||||||
|
contactsFetchInProgress.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
contactsList.setFastScrollEnabled(true);
|
|
||||||
contactsFetchInProgress.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void invalidate() {
|
public void invalidate() {
|
||||||
|
|
|
@ -136,7 +136,6 @@ public class ContactsManager extends ContentObserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized List<LinphoneContact> getSIPContacts() {
|
public synchronized List<LinphoneContact> getSIPContacts() {
|
||||||
setContacts(contacts);
|
|
||||||
return sipContacts;
|
return sipContacts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -411,11 +410,13 @@ public class ContactsManager extends ContentObserver {
|
||||||
return contacts;
|
return contacts;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized void onProgressUpdate(List<LinphoneContact>... result) {
|
protected void onProgressUpdate(List<LinphoneContact>... result) {
|
||||||
setContacts(result[0]);
|
synchronized (ContactsManager.this) {
|
||||||
contactsCache.clear();
|
setContacts(result[0]);
|
||||||
for (ContactsUpdatedListener listener : contactsUpdatedListeners) {
|
contactsCache.clear();
|
||||||
listener.onContactsUpdated();
|
for (ContactsUpdatedListener listener : contactsUpdatedListeners) {
|
||||||
|
listener.onContactsUpdated();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,7 +222,9 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
||||||
@Override
|
@Override
|
||||||
public void onContactsUpdated() {
|
public void onContactsUpdated() {
|
||||||
CallHistoryAdapter adapter = (CallHistoryAdapter)historyList.getAdapter();
|
CallHistoryAdapter adapter = (CallHistoryAdapter)historyList.getAdapter();
|
||||||
adapter.notifyDataSetChanged();
|
if (adapter != null) {
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue