Tuesday, April 24, 2012

lock screen sometime not display android

i created lock screen application.. Sometimes it give me a problem. problem is that some time default lock screen display rather than my lock screen and some time directly home screen display. i donot know where is the problem. please give me suggestion about this.



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



and create ScreenReceiver:
ACTION_SCREEN_OFF
ACTION_SCREEN_ON
ACTION_BOOT_COMPLETED



Refer this link: http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/



in manifeast file : declare service and receiver and permission



The problem is in BroadcastReceiver when
if (recievedIntent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
//call activity
}else if (recievedIntent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
}
but the activity call after screen on.. so what is missing or what is problem.. why it is happn pls rply.





No comments:

Post a Comment