简体   繁体   English

锁屏前的活动

[英]Activity in front of Lockscreen

I want to create an activity in front of the lockscreen. 我想在锁屏前面创建一个活动。 I don't want to skip the keyguard completely. 我不想完全跳过键盘锁。 I tryed it with the TYPE_SYSTEM_OVERLAY flag but there I can't handel any events. 我尝试过使用TYPE_SYSTEM_OVERLAY标志,但无法处理任何事件。 It works with FLAG_SHOW_WHEN_LOCKED but then there is a black background and i want it like on this picture: 它可以与FLAG_SHOW_WHEN_LOCKED一起使用,但是背景是黑色的,我想要这张照片:

An Activity without black background and event handling http://s1.directupload.net/images/130306/sctc586t.jpg 没有黑色背景和事件处理的活动http://s1.directupload.net/images/130306/sctc586t.jpg

It would be nice if it is like TYPE_SYSTEM_OVERLAY but with event handling. 如果它像TYPE_SYSTEM_OVERLAY但具有事件处理功能,那就太好了。 Is that possible? 那可能吗? I read that it is not possible with TYPE_SYSTEM_OVERLAY to get any Events but is there maybe another option to set an activity in front of the lockscreen? 我读到,用TYPE_SYSTEM_OVERLAY无法获得任何事件,但是也许还有另一种方法可以在锁屏前面设置活动? Maybe with root rights? 也许拥有根权? It should look like it is in the picture. 它看起来应该像图片中的那样。

To avoid black background try a translucent theme. 为避免黑色背景,请尝试使用半透明的主题。 At your manifest (activity or application) use android:theme="android:style/Theme.Translucent" 在您的清单(活动或应用程序)上使用android:theme="android:style/Theme.Translucent"

There is also a way to create widgets for lock screen of some devices from different manufactures, as far as I know HTC developer page has such a tool, but I have never tested and I am afraid that works only on sense devices. 据我所知,HTC开发人员页面具有这样的工具,还有一种方法可以为来自不同制造商的某些设备的锁屏创建窗口小部件,但是我从未测试过,恐怕只能在感应设备上使用。

If you are only interested for a devices you can also look at your manufactures developer page! 如果您只对设备感兴趣,还可以在您的产品开发者页面上查看!

Edit: 编辑:

Other related sites: 其他相关站点:

  1. Android Lock Screen Widget Android锁屏小部件
  2. Features of 4.2: http://developer.android.com/about/versions/android-4.2.html#Lockscreen 4.2的功能: http : //developer.android.com/about/versions/android-4.2.html#Lockscreen

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM