Method for sensing light being incident on an electronic device, the electronic device comprising a display and a light sensor arrangement mounted behind the display such as to receive incident light through the display, the method comprising the steps of: - periodically switching the display on and off depending on a control signal, wherein a period of said periodical switching is defined by the time of a succession of an on-state and an off-state of the display and a duty cycle of said periodical switching is defined by the ratio between the fraction of the period in which the display is in the on-state and the period, - generating a sensor signal by integrating the incident light by means of the light sensor arrangement for a total integration time (T_INT) comprising a plurality of said periods of periodical switching, - for each of the on-states included in the total integration time (T_INT), determining a respective first signal count (Dn+An) from the sensor signal being indicative of an amount of the incident light which is integrated for a predetermined time during the corresponding on-state, - for each of the off-states included in the total integration time (T_INT), determining a respective second signal count (An) from the sensor signal being indicative of an amount of the incident light which is integrated for the predetermined time during the corresponding off-state, - determining a display light level by subtracting the sum of all determined second signal counts from the sum of all determined first signal counts, by multiplying the result of said subtracting by the duty cycle and by the period, and by dividing the result of said multiplying by the predetermined time, - determining a third signal count (Aint+Dint) from the sensor signal being indicative of an amount of integrated incident light during the total integration time (T_INT), and - determining an ambient light level depending on the first, second and third signal counts (Dn+An, An, Aint+Dint) by subtracting the display light level from the third signal count (Aint+Dint). - periodically switching the display on and off depending on a control signal, wherein a period of said periodical switching is defined by the time of a succession of an on-state and an off-state of the display and a duty cycle of said periodical switching is defined by the ratio between the fraction of the period in which the display is in the on-state and the period, - generating a sensor signal by integrating the incident light by means of the light sensor arrangement for a total integration time (T_INT) comprising a plurality of said periods of periodical switching, - for each of the on-states included in the total integration time (T_INT), determining a respective first signal count (Dn+An) from the sensor signal being indicative of an amount of the incident light which is integrated for a predetermined time during the corresponding on-state, - for each of the off-states included in the total integration time (T_INT), determining a respective second signal count (An) from the sensor signal being indicative of an amount of the incident light which is integrated for the predetermined time during the corresponding off-state, - determining a display light level by subtracting the sum of all determined second signal counts from the sum of all determined first signal counts, by multiplying the result of said subtracting by the duty cycle and by the period, and by dividing the result of said multiplying by the predetermined time, - determining a third signal count (Aint+Dint) from the sensor signal being indicative of an amount of integrated incident light during the total integration time (T_INT), and - determining an ambient light level depending on the first, second and third signal counts (Dn+An, An, Aint+Dint) by subtracting the display light level from the third signal count (Aint+Dint).