The life cycle of a fly involves four stages: egg, larva, pupa, and adult.