Disabling automatic standby mode

You can prevent your app from automatically going into standby mode (due to a lack of user input) by using the flag SCREEN_IDLE_MODE_KEEP_AWAKE with the function screen_set_window_property_iv() from the screen.h header file. Only disable automatic standby mode when it is absolutely necessary for your app. For example, when playing a video. The usage is shown in the following code example, where screen_win is the window that should not go into standby mode:


screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_IDLE_MODE, &idle_mode);

In this example, the idle mode property (SCREEN_PROPERTY_IDLE_MODE) of the window screen_win, is set to SCREEN_IDLE_MODE_KEEP_AWAKE, so when screen_win is on the screen, it will not enter standby mode when there is no user input. However, if the user puts the tablet to sleep, the application will still enter standby mode.