KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Can we switch off an Android phone programmatically? I am using following snippet but it didn't work for me. KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Activity.KEYGUARD_SERVICE); KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE); lock.disableKeyguard(); // to disable lock.reenableKeygaurd();// to enable and I used the permission also.
Tags (comma-separated)
Save Edits
Cancel