Light activated switch - avoid flicker when turning on
You want hysteresis. Hysteresis is the same thing that keeps your thermostat from switching on and off every few seconds when the ambient temperature is very near the setpoint. Hysteresis can be implemented many ways.

You could introduce a delay after a state change. That is, when you change states, inhibit further changes for some time. This will at least limit the rate of the flashing. You might implement this with a microcontroller or some sort of discrete logic and a timer like the 555.

Alternately, you can introduce a degree of positive feedback such that the threshold brightness depends on if the light is currently on or off. For example, say the light is currently off, and the sensed brightness must go below "10" (some arbitrary unit) to trigger the light to turn on. When the light is on, the brightness must now increase to "15" before the light goes back off. So perhaps the brightness decreased to 10, the light turned on, and now the sensed brightness is 12, but this is less than the new threshold of 15. The Schmitt trigger is a kind of comparator with hysteresis.