2013年10月28日 星期一

Disable lockscreen

I am looking for a way to replace the stock lock screen (with an app, not a rom). What is the best way to do it, for a start to disable the lock screen on as much devices as possible? Thanks!
share|improve this question

4 Answers

KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
lock.disableKeyguard();
in androidmanifest:
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
share|improve this answer
3 
perfect. Thank you very much –  Weldeborn Jul 6 '11 at 6:38
2 
The class KeyguardLock has been deprecated. Setting the window flags as shown by @hsgubert below seems the current way to turn off the key guard/lock screen. –  pstoppani Feb 1 at 0:48

沒有留言:

張貼留言

Related Posts Plugin for WordPress, Blogger...