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,8 +228,10 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
@Override
|
||||
public void onContactsUpdated() {
|
||||
ChatListAdapter adapter = (ChatListAdapter)chatList.getAdapter();
|
||||
if (adapter != null) {
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
|
||||
|
|
|
@ -411,6 +411,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
|||
@Override
|
||||
public void onContactsUpdated() {
|
||||
ContactsListAdapter adapter = (ContactsListAdapter)contactsList.getAdapter();
|
||||
if (adapter != null) {
|
||||
contactsList.setFastScrollEnabled(false);
|
||||
if (onlyDisplayLinphoneContacts) {
|
||||
adapter.updateDataSet(ContactsManager.getInstance().getSIPContacts());
|
||||
|
@ -420,6 +421,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
|||
contactsList.setFastScrollEnabled(true);
|
||||
contactsFetchInProgress.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
if (searchField != null && searchField.getText().toString().length() > 0) {
|
||||
|
|
|
@ -136,7 +136,6 @@ public class ContactsManager extends ContentObserver {
|
|||
}
|
||||
|
||||
public synchronized List<LinphoneContact> getSIPContacts() {
|
||||
setContacts(contacts);
|
||||
return sipContacts;
|
||||
}
|
||||
|
||||
|
@ -411,13 +410,15 @@ public class ContactsManager extends ContentObserver {
|
|||
return contacts;
|
||||
}
|
||||
|
||||
protected synchronized void onProgressUpdate(List<LinphoneContact>... result) {
|
||||
protected void onProgressUpdate(List<LinphoneContact>... result) {
|
||||
synchronized (ContactsManager.this) {
|
||||
setContacts(result[0]);
|
||||
contactsCache.clear();
|
||||
for (ContactsUpdatedListener listener : contactsUpdatedListeners) {
|
||||
listener.onContactsUpdated();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void onPostExecute(List<LinphoneContact> result) {
|
||||
for (ContactsUpdatedListener listener : contactsUpdatedListeners) {
|
||||
|
|
|
@ -222,8 +222,10 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
@Override
|
||||
public void onContactsUpdated() {
|
||||
CallHistoryAdapter adapter = (CallHistoryAdapter)historyList.getAdapter();
|
||||
if (adapter != null) {
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
|
Loading…
Reference in a new issue