Always on top task
Jim Bachalo asked whether it is possible to write an application which is always on top, even if there is a call in progress. I created this post in order to be able to attach the example code (comments cannot have attachments on this forum). My conclusion is that there is no perfect solution using the PHONE_STATE broadcast as this broadcast is delivered before the In-call screen comes to the front. What this code does is a sort of a hack. Whenever we get a PHONE_STATE broadcast, we wait 1 sec and then we relaunch our activity. Obviously this is not perfect as the user sees the in-call screen flickering in and out and in theory, it is possible that 1 sec is too short on certain devices.