Is there any way to keep invalidating Custom view after regular intervals even when the Screen is Off. I'm working on a music visualizer that renders a plot based on the frequency of the currently playing audio, but if i turn the screen off and turn it on again after some time , I get a gap in my plot, which indicates that the Custom View was not being invalidated even though music was not paused
Edit : I used a workaround, and now it works fine. Instead of drawing directly to the actual canvas, draw to secondary canvas object that is not linked to any view. When the actual canvas comes back into focus, just copy the content of the secondary canvas onto the actual canvas. In this way even is the view is not in focus, the drawing will take place on the secondary canvas, without any gap.