10-07-2009 02:48 PM
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..
10-07-2009 03:01 PM
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.
04-13-2012 10:39 AM
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...