Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Regular Contributor
sho3ebovich
Posts: 68
Registered: ‎12-22-2011
My Carrier: ---

Check Idle State of the device

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.

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008

Re: Check Idle State of the device

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;
    }

 

Please use plain text.