How do you draw a view on top of all other activities regardless of what they are showing and without using transparent activities or consuming its touch events.
Its lik
Take a look at this cool article, I think that's exactly what you want :
http://www.piwai.info/chatheads-basics
In short : you want to add this permission to your manifest :
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
For api >= 23, you'll need to request the runtime permission Settings.ACTION_MANAGE_OVERLAY_PERMISSION
Then in a service, get the window manager
windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
and add your views with the addView
method
Take a look at WindowManager
. You can do something like (WindowManager)mContext.getSystemService("window");
if you want to get the root view and use the method addView(view, params)
if you want to add a view.