I'm trying to disable screen lock. I want the screen to go off after timeout, but to go on again with my app when touched.
Since keywardlock is deprecated, I tried the following in onCreate():
final Window win = getWindow();
win.setFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED,
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
Just in case, I added the following in the manifest (is this needed??):
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.FLAG_SHOW_WHEN_LOCKED" />
Still, after my usual timeout, the screen is locked...
What am I doing wrong?? Thanks!