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