Reputation: 597
I am working on android fingerprint Screen locker. how i locked and unlocked android device Programetically. i used onTouchListner on an image and Count the time of Action_down (means thumb pressed). on Action_Down I want to code unlock.
anyone help Please
Upvotes: 1
Views: 1256
Reputation: 1073
To lock your device programmatically use:
DevicePolicyManager deviceManger = (DevicePolicyManager)getSystemService( Context.DEVICE_POLICY_SERVICE);
Then call:
deviceManger.lockNow();
Wherever you need to lock it.
Hope it helps!
Upvotes: 2