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
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.