private void controlThumbUploads() { // Log.d(LOG,"*** controlThumbUploads, index: " + index + " list: " + list.size()); if (index < list.size()) { if (list.get(index).getDateThumbUploaded() == null) { executeThumbUpload(list.get(index)); } else { index++; controlThumbUploads(); } } if (index == list.size()) { // webCheckResult = WebCheck.checkNetworkAvailability(getApplicationContext()); if (webCheckResult.isWifiConnected()) { index = 0; controlFullPictureUploads(); } } }
private void controlFullPictureUploads() { if (index < list.size()) { if (list.get(index).getDateFullPictureUploaded() == null) { executeFullPictureUpload(list.get(index)); } else { index++; controlFullPictureUploads(); } } // Log.w(LOG, "*** check and remove photos uploaded from cache"); List<PhotoUploadDTO> pendingList = new ArrayList<>(); for (PhotoUploadDTO dto : list) { if (dto.getDateThumbUploaded() == null || dto.getDateFullPictureUploaded() == null) { pendingList.add(dto); } } list = pendingList; saveCache(); }