Android Lock Screen Display

Is it possible to keep an Android device in a locked state while something is displayed on the screen? This means that all functions will work as if the device is locked (since it will be locked), and the only difference is that something is displayed on the screen. The main purpose of this question is to display something in the same way as the notification bar in a locked state and the ability to return to the original lock screen instead of something being displayed on the device, and as soon as the lock screen is pressed, it is skipped device, and you must click it again to return to the locked interface.

+4
source share
3 answers

Add this line to your activity. A window will be displayed even when the screen is locked, as easy.

getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); 

Greetings .......... !!!!!!!!!

+3
source

You can do it. There are some configuration tools and instructions on this front, but from a development perspective, you want to take a look at CommonsWare's comments on this .

There is some open source code in which there are some materials that you can view about how other people did it, but it sounds like the Android team is moving away from enhancing this functionality.

Update:. Your question also aroused my interest in this front, so I looked at Google groups on this topic and some others. It is interesting , but older, which contains some information about it.

+1
source

You can find out how this can be done if you look at the contact open source project owner who adds a message to the lock screen.

 "if you find this phone please call +49 ..." 

Android 4.2 gives users the ability to add widgets to the lock screen .

0
source

Source: https://habr.com/ru/post/1381732/


All Articles