11-02-2012 04:05 PM
How can i check the idle state of the device .
in other word how can i check if the user not touch or make and action on devcie for specific period .
Thanks.
11-02-2012 04:46 PM
Something like this?
/**
* Determine if device is idle. We define this as "inactive for 30 seconds"
* This is used to avoid any background processing that would noticeably
* slow the unit down. If the device is idle, we probably won't disturb the user.
* @return true if idle
*/
public synchronized boolean deviceIdle()
{
if (DeviceInfo.getIdleTime() > 30L)
return true;
else
return false;
}