显示在锁定屏幕的Android [英] Displaying on Locked Android Screen
问题描述
将有可能保持在Android设备处于锁定状态,而其显示在屏幕上的东西吗?这意味着所有的功能将工作,如同设备被锁定(因为它会被锁定)和唯一的区别是,有显示在屏幕上的东西。这个问题的主要目的是在锁定状态下,显示的东西就像通知栏做,并且能够恢复到原来的锁屏界面,而无需在设备上,一旦锁定屏幕上显示的东西是pressed它空白出设备,并且必须preSS它再次返回到锁定接口。
Would it be possible to keep an android device in a locked state while having something displayed on the screen? Meaning all functionality would work as if the device is locked (since it would be locked) and the only difference would be that there is something displayed on the screen. The main purpose of this question is to display something just as the notification bar does in a locked state and to be able to return to the original lock screen instead of having something be displayed on the device and once the lock screen is pressed it blanks out the device and you must press it again to return to the locked interface.
推荐答案
这行添加到您的活动。窗口将显示,即使当屏幕被锁定,就这么简单。
Add this line to your activity. The window will be shown even when screen is locked, as simple as that.
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
干杯.......... !!!!!!!!!
Cheers..........!!!!!!!!!
这篇关于显示在锁定屏幕的Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!