I am try to make Chathead type overly draw via Android Service on my app like bellow image.
This chat head app works on An
it looks like your addView() method is failing.
I've fixed that issue (in some cases) using WindowManager.LayoutParams.TYPE_PHONE
for Android SDK under 8.0 and WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
for 8.0 and above.
You could add some automatic selection in order to grant major compatibility (depending on the active SDK platform) but since Google Play doesn't allows APKs under 8.0, it's clearly unnecessary.
Hope it helps.