"Screen overlay detected" dialog? I have a Nexus 5 phone and ever since I allowed a system update, it won't let me post pictures to Instagram. It keeps talking about turning off a "screen overlay", but then when I try to follow the steps to get to that setting, it just sends me in a loop and doesn't actually let me change anything.

(Click image to enlarge)
Simple Resolution / Answer

I had this same problem with my Nexus 5X, using Android M.  I also went ahead &amp; turned all the permissions off, except for Twilight, the suspected culprit.  I still had the problem.  So I went ahead and also turned over the overlay for Twilight, and I did not have the problem.

So, Twilight is the "problem", in my case and in the case shown above.  (I put problem in quotes because it seems to me like Twilight should not be to blame in this case.  Instead, multiple overlays should be possible.)



Where is This Setting??

For those who had this problem, or want to understand what we're talking about, here are the steps to get to this "hidden" setting, within Android M:


Open settings (the nut / gear).
Scroll down to Apps.
From within the Apps portion of settings, again choose the settings gear / nut.
Choose Draw over other apps.
(Optional) Click on the additional menu (the 3 dots), then choose Show system to get at all of the apps that are asking to draw over others, including system apps like Phone Services.




What's Really Going On?

Last little tidbit:  I am not 100% certain about this, but from what I know of Android, it seems things work as follows in Mashmallow:


Permissions are not asked / required upon app installation, but rather upon when the app needs that permission.  Similarly, some permissions can be granted or rejected... the app will work to the best of its capability, if the permission is rejected.
Since this is the case, any time an app asks for permission to a particular thing, such as drawing over other apps, the user's yes or no response is recorded.


As the user, you can change your response later, which is the essence of what that pop-up window is asking:  the window is saying, "I cannot do what I need to do, unless you change your answer to that earlier problem".  (However, without highlighting which app is the actual problem, the error seems fairly useless, IMHO.)