public boolean checkIfConnectionIsAvailable() { boolean connection = NetworkUtils.isNetworkAvailable(getActivity()); if (mIsConnectionAvailable) { FindPatientsManager fpm = new FindPatientsManager(); fpm.getLastViewedPatient(mFpmResponseListener); } return connection; }
public void updateLastViewedList() { if (NetworkUtils.isNetworkAvailable(getActivity())) { setRefreshing(true); mSwipeLayout.setRefreshing(true); mSwipeLayout.setEnabled(false); mEmptyList.setVisibility(View.GONE); patientsRecyclerView.setVisibility(View.GONE); mSpinner.setVisibility(View.GONE); if (mAdapter != null) { mAdapter.clear(); } FindPatientsManager fpm = new FindPatientsManager(); fpm.getLastViewedPatient(mFpmResponseListener); } else { mEmptyList.setText(getString(R.string.find_patient_no_connection)); patientsRecyclerView.setVisibility(View.GONE); mEmptyList.setVisibility(View.VISIBLE); mSpinner.setVisibility(View.GONE); mSwipeLayout.setRefreshing(false); } }