Added flags so Activity is displayed above lock screen, fixes #1
This commit is contained in:
parent
a196c64486
commit
68ea94e8b5
|
@ -26,6 +26,7 @@ import android.media.AudioTrack;
|
||||||
import android.media.MediaPlayer;
|
import android.media.MediaPlayer;
|
||||||
import android.media.MediaRecorder;
|
import android.media.MediaRecorder;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.WindowManager;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
@ -50,6 +51,14 @@ public class MainActivity extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
// Set flags so Activity is displayed above 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
|
||||||
|
);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
// Init views
|
// Init views
|
||||||
|
|
Loading…
Reference in New Issue