0

I am developing an application which requires location permission for Android Marshmallow. I followed all the steps (function calls) required to implement that. When I run the application it pop up a box asking for the user permission. When I select yes, it display another pop up saying "Screen overlay detected" and that takes me to setting screen where list of applications is shown. There I uncheck all the applications and press back button to return to my app. When onRequestPermissionsResult() callback is called, I can see the permission is not granted. It happen all the time.

Why does it display "screen overlay detected" all the time as I have already unselected/unchecked all the apps in the list?

Why permission is not granted although I have pressed yes when it ask for the permission?

Floern
  • 33,559
  • 24
  • 104
  • 119
user2679476
  • 365
  • 3
  • 12
  • You are using screen filtering. http://android.stackexchange.com/questions/126798/screen-overlay-detected-dialog – android_eng Sep 29 '16 at 02:21
  • Probably this issue is similar to this: http://stackoverflow.com/questions/35453759/android-screen-overlay-detected-message-if-user-is-trying-to-grant-a-permissio – user2679476 Sep 29 '16 at 02:24
  • Try this it may be work http://stackoverflow.com/a/41221852/5488468 – Bipin Bharti Jan 03 '17 at 11:00

2 Answers2

0

The reason: This message appears when you’re running a floating app, and then start a newly installed one, which requests access rights. Floating apps include the chat heads of Facebook Messenger that can appear floating above other apps, etc.

Affected Smartphones: Users across the internet have reported experiencing this problem on Samsung and Motorola smartphones. It seems likely to affect many manufacturers. AndroidPIT managed to replicate the behavior on a Vodafone and a Samsung smartphone.

Problem apps: We replicated the problem using Drupe, but CleanMaster, Lux and Twilight have all been blamed for the problem.

The technical background: As a security measure, apps ask for permission to use certain parts of your phone (internal storage, camera, etc.). In theory, a display overlay can interfere with the dialogue requesting permission, so you need to disable the feature to interact with the dialogue.

Now the Solution, how to fix it:

Step one: "Screen overlay detected" fix

Find you what apps have permission to draw over the screen. On a non-Samsung smartphone, follow these steps:

  1. Open the Settings
  2. Tap the search icon at the top right
  3. Enter the search term “draw”
  4. Tap Draw over other apps
  5. Select Draw over other apps

For Samsung users:

  1. Open the Settings
  2. Then Applications > Application manager
  3. Press on More > Apps that can appear on top

Step two:

You will find yourself in front of a list of apps that have permission to use floating buttons or other screen overlays. Now you need to identify the problem app and temporarily deny it permission to draw over the screen. Here is are some pointers on how to identify the app that’s causing trouble:

  1. Do you see an app bubble on your screen? If do, this app is almost certainly the cause. Either you hide the app bubble or disable the app in the list
  2. Do you have an app installed that changes the colors on the display or adjusts the brightness?
  3. Reportedly, Clean Master can be a trouble maker. If you see Clean Master in the list, disable it
  4. If there’s no obvious cause, disable everything

Step three:

Now you can try launching the app again, and it should request permissions without the “Display overlay detected” error getting in the way.

For Samsung users: The one-handed keyboard setting could be the root cause. Deactivate it by going to Settings> Advanced features > One-handed operation.

Step four: reactivate screen overlays

In order for the app(s) that you have disabled in step two to work again, you need to re-enable its overlay permissions. If you turned off all apps, it might be worth considering only reactivating those apps that you actually use.

This is a rather inelegant workaround, but it's the best we have until Google makes the necessary changes to prevent app overlays from interfering with permission dialogues.

Has this guide helped? If you are still experiencing the error after following our guide, leave a comment, so I can try and address the problem.

lRadha
  • 641
  • 6
  • 16
  • I am using a Samsung phone. In the list of "Apps that can appear on top", I have unchecked all the app, now none of them has permission to appear on the top. I have also disable "One handed operation". But still face the same issue. It pop up "screen overlay detected". – user2679476 Sep 29 '16 at 23:09
0
This is the issue reported many times.

The possible solutions are:
1) delete apps like(cleanmaster, battery saver, etc.) or go to settings/app/cleanmaster/force stop.

2) Or you can also remove the permissions for cleanmaster.

3) determine which app is drawing over other apps. Turn that off beforehand.

Note: Sometimes unchecking does not actually solve the problem of the overlay.

Shreyansh Patni
  • 401
  • 2
  • 17