I want to make a screen saver application, such as a PC. If the user does not interact with the device for 10 minutes, I can play many photos.
But I have a question: how to check if the user interacts with my device?
I read Detection if user interacts with phone? , he said that I can track touch events, but my screen saver application requires checking other applications if the user interacts with the device, so I can not use the methods.
But the system setup can turn the screen on and off when the user does not interact with the device several times. How to do this system? Can I change the source of the system, can you give a hint to tell me which code I can change, or tell me how the system checks if the user is interactive with the device?
edit: I am looking for source code, I am using:
try {Settings.System.putInt (getContentResolver (), Settings.System.SCREEN_OFF_TIMEOUT, 8000);
} catch (NumberFormatException e) {
Log.e("aa", "could not persist screen timeout setting", e);
}
but this is not an effect
source
share