void (boolean isAssigned) { if (isAssigned) { if (myAssignments == 0 && myIndicator == null) { myIndicator = startLoading(); } myAssignments++; } else { myAssignments--; if (myAssignments == 0 && myIndicator != null) { myIndicator.cancel(); myIndicator = null; } } assert myAssignments >= 0; }