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.

inside custom component

Java Development

Reply
Developer
Posts: 158
Registered: ‎08-20-2009
My Device: Not Specified

Unlock device listener

i want to be able to detect when a device is going from a locked state to a unlocked state(i need to do some action then)...i looked at the Interface MemoryCleanerListener..but this detects only the device going from unlocked to locked not the other way round (what i want)

could any one please tell me how this could be done..

 

Regards,

Kaddy

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Unlock device listener

I set a property when the device gets locked.

 

If I'm coming to foreground, then the device is unlocked. If this "wasLocked" property is set, the this tells me that I transitioned from a locked to unlocked state.

 

 

 

 

 

 

Developer
Posts: 83
Registered: ‎02-03-2009
My Device: 9500/9520/9800/9810
My Carrier: TMobile

Re: Unlock device listener

even if this quite an old topic - I wanted to contribute:

 

register an PersistentContentListener - then you will be notified by an persistentContentStateChanged call with the state 'PERSISTENT_CONTENT_UNLOCKED' if the user have succesfully unlocked the device... [no matter if device encryption is enabled or not]

 

so with the combination of the MemoryCleanerListener (EVENT_DEVICE_LOCK) and the PersistentContentListeneryou can be implement a LOCK and UNLOCK notifier...

[FileScout] | [iMazing] | [GPSLogger II] | [Iconify] | [TOMPlayer]