use of net.iGap.observers.interfaces.OnContactsGetList in project iGap-Android by KianIranian-STDG.
the class FragmentSyncRegisteredContacts method onContactsGetList.
@Override
public void onContactsGetList() {
if (getActivity() == null || getActivity().isFinishing()) {
return;
}
if (results == null || results.size() == 0) {
results = DbManager.getInstance().doRealmTask(realm -> {
return realm.where(RealmContacts.class).limit(ContactManager.CONTACT_LIMIT).findAll().sort("display_name");
});
contactListAdapter2 = new ContactListAdapter2(results);
realmRecyclerView.setAdapter(contactListAdapter2);
if (results.size() == 0) {
// No Contacts Exist Go to Main
if (getActivity() == null || getActivity().isFinishing()) {
return;
}
Intent intent = new Intent(getContext(), ActivityMain.class);
intent.putExtra(ARG_USER_ID, userID);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
G.context.startActivity(intent);
G.fragmentActivity.finish();
}
}
hideProgress();
}
Aggregations