Water heater working when flushing a toilet
Do you have a mixing valve somewhere in the supply to the toilet ? 

In cold climates it is common to mix some hot water in with the cold so that the water supplied to the tank does not cause condensation on the outside of the tank do to a temperature difference between the water and the ambient room temp. 

Thus if your toilet is calling for water it will use some hot water from the  hot water heater.