I\'ve tried googling, and looking on stackoverflow as well, but I can\'t seem to find any satisfying answer as to how the \"App lock\" applications(eg: ZDBox, App Lock, etc.
they are watching logcat output. whenever you start an activity, you can find specific logcat. like this,
I/ActivityManager( 585): Starting activity: Intent { action=android.intent.action...}
if this logcat printed by locked app, locker service starts password screen.
there is a service running in the background to read the activity stack. if find new activity, will start the passwordActivity