Fixed crash when contacts adapter is null

This commit is contained in:
Sylvain Berfini 2019-02-25 12:36:49 +01:00
parent 158dc1a574
commit 8a811e9597
2 changed files with 4 additions and 1 deletions

View file

@ -655,6 +655,7 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
} }
private synchronized void destroyCore() { private synchronized void destroyCore() {
Log.w("[Manager] Destroying Core");
sExited = true; sExited = true;
ContactsManagerDestroy(); ContactsManagerDestroy();
BluetoothManagerDestroy(); BluetoothManagerDestroy();
@ -861,6 +862,8 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
// at 0 // at 0
if (LinphonePreferences.instance().isPushNotificationEnabled() if (LinphonePreferences.instance().isPushNotificationEnabled()
|| LinphonePreferences.instance().isBackgroundModeEnabled()) { || LinphonePreferences.instance().isBackgroundModeEnabled()) {
Log.w(
"[Manager] Setting network reachability to False to prevent unregister and allow incoming push notifications");
mCore.setNetworkReachable(false); mCore.setNetworkReachable(false);
} }
} }

View file

@ -223,7 +223,6 @@ public class ContactsFragment extends Fragment
return; return;
} }
changeContactsToggle(); changeContactsToggle();
mContactAdapter.setIsSearchMode(true);
List<LinphoneContact> listContact; List<LinphoneContact> listContact;
@ -237,6 +236,7 @@ public class ContactsFragment extends Fragment
} }
mContactAdapter = new ContactsAdapter(mContext, listContact, this, mSelectionHelper); mContactAdapter = new ContactsAdapter(mContext, listContact, this, mSelectionHelper);
mContactAdapter.setIsSearchMode(true);
// mContactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE); // mContactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
mSelectionHelper.setAdapter(mContactAdapter); mSelectionHelper.setAdapter(mContactAdapter);