I had quite a few problems with this using the same links that you provided. But then I found this: http://www.piwai.info/chatheads-basics/
This is basically similar to other solutions, except that the arguments of WindowManager LayoutParams are TYPE_PHONE and FLAG_NOT_FOCUSABLE .
This solution not only worked for me (I tested on LG Urbane), the onTouchEvent had all the actions (down, move and up) that the other solutions said you wonβt get.
Since all sensory events are transmitted through the view, in theory we can use gesture detectors to receive callbacks for things like double taps and outliers. I have not tried this yet.
Regardless of what the link above should help you overcome the initial problems you are facing.
source share