问题
I have a running android Service. It runs even on the lockscreen, and i want it to somehow Unlock the lockscreen.
How can i 'interfere' with the lockscreen activity or whatever the lockscreen is?
Update:
I want my service to Unlock the lockscreen, just like if the user slided the unlock thing.
Got it?
回答1:
You can. Use this code:
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
This will unlock the Keyguard automatically.
来源:https://stackoverflow.com/questions/6051010/unlock-the-android-lockscreen-activity