Hi friends, I want to lock the screen through my program. i am using the following code to do the same..But its not working for me..I dont know where i am wrong..even i am not getting any errors in logcat..I am using 1.6
public class KeyGaurd extends Activity {
KeyguardManager keyguardManager;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
keyguardManager =
(KeyguardManager)getSystemService(Context.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
lock.reenableKeyguard();
}
And i used the permission also
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"></uses-permission>