private void setNumReviews(TrainerViewHolder holder, Trainer trainer) { final TextView tvNumReviews = holder.tvNumReviews; ParseQuery<ParseObject> query = ParseQuery.getQuery("Review"); query.whereEqualTo("reviewee", trainer); query.countInBackground(new CountCallback() { public void done(int count, ParseException e) { if (e == null) { Log.d("DEBUG", "Number of reviews: " + count); if (count == 1) { tvNumReviews.setText(count + " Review"); } else { tvNumReviews.setText(count + " Reviews"); } } else { Log.d("DEBUG", "Failed to get number of reviews"); } } }); }