Activity in front of Lockscreen

梦想的初衷 提交于 2019-12-08 02:20:07

问题


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. It works with FLAG_SHOW_WHEN_LOCKED but then there is a black background and i want it like on this picture:

An Activity without black background and event handling http://s1.directupload.net/images/130306/sctc586t.jpg

It would be nice if it is like TYPE_SYSTEM_OVERLAY but with event handling. 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? Maybe with root rights? It should look like it is in the picture.


回答1:


To avoid black background try a translucent theme. At your manifest (activity or application) use 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.

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
  2. Features of 4.2: http://developer.android.com/about/versions/android-4.2.html#Lockscreen


来源:https://stackoverflow.com/questions/15259892/activity-in-front-of-lockscreen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!