I want to continue running my application when the back light and screen lock. Is it possible or not. Anybody kindly guide me?
timer Function
receiver
are running in Background. Inside the receiver I am getting the Data.
I want to continue running my application when the back light and screen lock. Is it possible or not. Anybody kindly guide me?
timer Function
receiver
are running in Background. Inside the receiver I am getting the Data.
If you are using Timer
to manage your Application
, I would insist that you should use AlarmManager
which is an inbuilt Android Facility that Android knows better. In Timer
the problem can be that when Android seeks resources for any other Application or something like that it may kill your Timer thread and get the resources where as it won't kill the AlarmManager
service that is running because that is what Android knows. You can check my question here
to get further idea.
Following source will help you to unlock the screen.I hope this will help you a bit.
KeyguardManager mKeyGuardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE);
KeyguardLock mLock = mKeyGuardManager.newKeyguardLock("your_activity_name");
mLock.disableKeyguard();
Here Code tht will help you
KeyguardManager mKeyGuardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE);
KeyguardLock mLock = mKeyGuardManager.newKeyguardLock("activity_classname");
mLock.disableKeyguard();
And this is the Reference Link