1

In my application I'm trying to implement a popup which will be overlay on other applications. I did it by adding this permission SYSTEM_ALERT_WINDOW in the manifest. It works fine, but on Android 6 I know that I need to request on runtime a permission to "Draw over other apps".

I entered to this settings in my phone and saw that Facebook, Messenger, Skyoe and other apps are allowed to draw over other apps without asking this permission during the installation process (on android 6) and was wondering how can I do that? is targeting to sdk version below 22 will solved this? if so, is there another solution instead of targeting to a lower sdk version?

for example, I uninstalled the facebook messenger application, and install it again, just opened it without completing the registration process, then I opened the settings and clicked on "Draw over other apps" and it was automatically set to "Yes" means that the messneger app can draw over other applications.

Elior
  • 3,178
  • 6
  • 37
  • 67
  • 2
    Apps installed on Android 6.0.1 and higher that request `SYSTEM_ALERT_WINDOW` automatically get it. See [this blog post](https://commonsware.com/blog/2016/03/24/system-alert-window-now-more-hidden-than-ever.html) and [this blog post](https://commonsware.com/blog/2017/05/11/system_alert_window-updates.html). "I know that I need to request on runtime a permission" -- `SYSTEM_ALERT_WINDOW` is not a permission that you request via `requestPermissions()` and the rest of the runtime permission system. – CommonsWare May 22 '17 at 11:26
  • @CommonsWare thanks for the blog posts. So it seems that every app that request this permission and installed from google play will automatically allowed to draw layouts over other application. mine is still under development.. so i tought that even if I installed it directly from android studio it will be allowed automatically to draw over other apps. anyway thanks :) – Elior May 22 '17 at 15:10

0 Answers0