Skip to content

Instantly share code, notes, and snippets.

@xanderblinov
Created December 22, 2015 09:44
Show Gist options
  • Save xanderblinov/01abb0b1bdcbc062e972 to your computer and use it in GitHub Desktop.
Save xanderblinov/01abb0b1bdcbc062e972 to your computer and use it in GitHub Desktop.
Overlay for lock screen
<activity android:name=".MainActivity"
android:showOnLockScreen="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON|
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED |
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
setContentView(R.layout.activity_main);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment