I am using Keyguard Manager in my activity to unlock the device, but it is behaving strangely. I tested it with two devices, on Nexus its working fine but in samsung Galaxy S, it's not working.
My Code is:
PowerManager pm = (PowerManager) ctx.getSystemService(Context.POWER_SERVICE);
WakeLock wakeLock = pm.newWakeLock((PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP),"mini");
wakeLock.acquire();
KeyguardManager keyguardManager = (KeyguardManager) ctx.
getSystemService(Context.KEYGUARD_SERVICE);
KeyguardLock keyguardLock = keyguardManager.newKeyguardLock("mini");
keyguardLock.disableKeyguard();
Can anyone Help?
I found this solution,here mContext is the context of your activity,i am using it outside the activity.