Best way to implement Screen timeout?
Hello,
I am trying to implement a basic screen timeout where the current screen is changed to the startup screen after a set time.
The timeout itself is straightfoward to implement using a tickcounter. However, the problem I am facing is resetting this counter whenever the screen is touched. I could possibly add a reset function to every button I have in the current screen but I also need the counter to be reset when the user touches any part of the screen and not just the interactive ones.
At first instance, I have utilized the handleClickEvent of the screen to basically detect any touch, which works in detecting all touches but unfortunately it also masks the button press events, so none of the buttons are interactive anymore.
It is possible that I use the clicklistener on all the buttons and basically handle the presses through that but this makes the code a bit complicated and this what I am trying to avoid.
I would like to know if there is a simpler way. So any input would be greatly appreacited.
Many thanks,
Samer