Lockscreen

Quickly share your Android Code Snippets here...

Lockscreen

Postby neex1233 » Fri Mar 26, 2010 3:46 am

Could somebody post a code snippet that goes to the lockscreen? Thanks. :)
neex1233
Freshman
Freshman
 
Posts: 4
Joined: Wed Mar 24, 2010 3:46 pm

Top

Postby shishir.bobby » Mon Mar 29, 2010 2:09 pm

here

KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
lock.disableKeyguard();



u need to give permissions for it


<uses-permission android:name="android.permission.DISABLE_KEYGUARD"></uses-permission>
<uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>



i hvnt tested this code on real device,but m sure it will work...

may be this will help u



regards
shishir.bobby
shishir.bobby
Experienced Developer
Experienced Developer
 
Posts: 76
Joined: Thu Apr 09, 2009 11:41 am

Postby neex1233 » Mon Mar 29, 2010 9:49 pm

Awesome, thanks so much!
neex1233
Freshman
Freshman
 
Posts: 4
Joined: Wed Mar 24, 2010 3:46 pm

Postby shishir.bobby » Tue Mar 30, 2010 5:17 am

anytime man......did u try dat snippet on device??
shishir.bobby
Experienced Developer
Experienced Developer
 
Posts: 76
Joined: Thu Apr 09, 2009 11:41 am

Re: Lockscreen

Postby batgun » Thu Feb 23, 2012 8:26 am

It gives error
batgun
Freshman
Freshman
 
Posts: 2
Joined: Thu Feb 23, 2012 7:59 am

Top

Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 8 guests