We measure the time-integrated CP asymmetry in D0→KS0KS0 decays reconstructed in e+e−→cc events collected by the Belle and Belle II experiments. The corresponding data samples have integrated luminosities of 980 and 428 fb−1, respectively. To infer the flavor of the D0 meson, we exploit the correlation between the flavor of the reconstructed decay and the electric charges of particles reconstructed in the rest of the e+e−→cc event. This results in a sample which is independent from any other previously used at Belle or Belle II. The result, ACP(D0→KS0KS0)=(1.3±2.0±0.2)%, where the first uncertainty is statistical and the second systematic, is consistent with previous determinations and with CP symmetry