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
New Developer
amitnath
Posts: 16
Registered: 09-12-2008
Accepted Solution

Detecting Device Lock state ?

How does one detect that the Blackberry (version 4.2 or greater) is currently password locked ?

 

Is there an event that is triggered when the device goes from:

- unlocked to locked state (and)

- locked to unlocked state

 

thanks

 

Amit

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

Re: Detecting Device Lock state ?

See ApplicationManager.isSystemLocked().

 

Also see the MemoryCleanerListener interface. There is an event passed to this listener when the system is locked.

 

 

 

 

Please use plain text.
New Developer
amitnath
Posts: 16
Registered: 09-12-2008

Re: Detecting Device Lock state ?

thanks the MemoryCleanerListener interface suggestion did the trick
Please use plain text.
Developer
EpicDraws
Posts: 109
Registered: 02-09-2009

Re: Detecting Device Lock state ?

While the MemoryCleanerListener works for this, I always find it enables the MemoryCleaner which causes an hourglass to pop up every time the device is locked while it frees memory. Is there a way to avoid this? Perhaps this is another way to detect the lock? You can use the isSystemLocked() but I really need an event so I don't have to have a thread sitting there polling. I know this is possible as other locking apps are able to detect the lock key and they do not even show up under the Reigstered Memory Cleaners in the options screen.

 

Thanks!

Please use plain text.