A few years ago, I wrote an alarm app that worked on Android 2, and I\'m now trying to upgrade it to work on Android 4. Specifically, on the Samsung Galaxy S4.
On A
One of the questions you linked to has an answer that appeared to solve this issue for me.
This is the code I am using which appears to be working:
@Override
public void onAttachedToWindow() {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
| WindowManager.LayoutParams.FLAG_FULLSCREEN);
super.onAttachedToWindow();
}
I'm also explicitly declaring this in the activity definition in the manifest:
Android activity over default lock screen