• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Need help with app

Gheter

Lurker
Hi,

This is my first post so please forgive any errors.
I am making an app that locks your phone at a voice command.

Sadly, I cannot even get the phone to lock.

This is the code I am using:

KeyguardManager mgr = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = mgr.newKeyguardLock(KEYGUARD_SERVICE);
lock.reenableKeyguard();

The app doesnt even install.

If anyone can tell me how to lock the phone trough code please reply

Thanks
Raghav Sood
 
Back
Top Bottom