Android activity over default lock screen

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON|
            WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD|
            WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED|
            WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);

try using this flags to disable lock screen when the activity is started.

After API level 17 you can use

<activity
        android:name=".yourActivityName"
        android:showOnLockScreen="true"
        android:screenOrientation="sensorPortrait" >

showOnLockScreen like in the example…

Leave a Comment