Display a view using windowmanager on lock screen

后端 未结 3 2014
梦毁少年i
梦毁少年i 2021-02-01 09:29

I have a float icon that stays on top of all activities, but when the device get locked it disappear until the device get unlocked.

Another meaning, I want to display a

3条回答
  •  春和景丽
    2021-02-01 09:47

    although the question is answered, some explanation:- using the TYPE_PHONE window with FLAG_SHOW_WHEN_LOCKED will only show on lock screen if that window is full screen -visit android reference, whereas using TYPE_SYSTEM_ERROR window type doesn't have the full screen restriction, thus solving the problem.

    and as asked by @milosmns, a workaround for this can be adding a delay say about 100ms ,to your code that is displaying a window on incoming call screen will work like a charm.

提交回复
热议问题