×
A new build of Corona SDK is now available to subscribers. Not a subscriber? Subscribe now.
CoronaSDK 2012.821 | Released: 23 May 2012, 2:01am | What's New | Download Now

system.setIdleTimer()

Description:

Controls whether the idle timer is enabled. If enabled is true, the timer will be active (default); inactive if false. When active, the idle timer dims the screen and eventually puts the device to sleep when no user activity occurs (e.g. screen touches).

Syntax:

1
system.setIdleTimer( enabled )

Example:

system.setIdleTimer( false )  -- disable (turn off) the idle timer
 
system.setIdleTimer( true )  -- enable (turn on) the idle timer

Parameters:

enabled

Either true or false to enable or disable the idle timer.

Returns:

Nothing.

Remarks:

Note: This API will not disable the screen saver on the Mac or Windows simulator.

Supported on operating systems and platforms for build numbers shown:
  • Mac OS X:
    --
  • Windows:
    --
  • iOS:
    Coroina SDK 1.0
  • Android:
    Build 2011.299

Replies

dutchottie
User offline. Last seen 17 hours 44 min ago. Offline
Joined: 1 Feb 2012

Is there a way to reset the idleTimer?
Say I've got an app that just uses the accelerometer so I turn off the idleTimer. Then when the games ends and returns to a menu screen, I want the idleTimer back on.
But if I do that now, the system remembers it's not been touched so at the moment I reenable the idleTimer the screen dims.

Marco