Android “Screen Detection” message if user is trying to grant permission when showing notification

I have Android Marshmallow on Nexus 6. I am trying to solve the following problem:

If the user tries to grant permission while the notification is displayed, the message “Screen overlay detection” appears and the request permission dialog disappears - of course, the application does not receive the requested permission. (Check screenshot)

I tried to fix the problem by adding the "DRAW OVER OTHER APPS" permission - android.permission.SYSTEM_ALERT_WINDOW to the manifest, but no luck.

PS: I'm sure the problem is caused by a notification. I don’t have installed applications that are superimposed on top of other applications, I even turned off all applications with the “Draw other applications” permission in the settings. Did not help..

Does anyone know a solution to this problem?

enter image description here

+78
android android-6.0-marshmallow permissions
Feb 17 '16 at 10:16
source share
13 answers

In the circumstance that I encountered, I myself caused a problem. This was the result of using Toast to display information to the user at the same time as I requested permission. Both of these actions together cause this type of error.

Other answers may solve the problem of another user. But I would like to point out that you should be careful when you have your own overlay errors. Be careful when overlaying something in the view while asking for permission.

+73
04 Oct '16 at 16:31
source share

Uninstall the Clean Master application. I deleted it and the problem is resolved.

+8
Jul 24 '16 at 8:10
source share

This problem arises due to some kind of criminal application like Twilight, clean-master, drupe, etc.

To solve this problem, you must turn off screen overlay for these malicious applications.

I have moto g4 plus, and here is how I solve this problem

Go to Settings → Select applications ---> again select the settings icon in Applications ---> select drawing over other applications ---> and disable applications that are guilty of other applications.

what am I doing, checking each application, disabling this permission and trying to run my application, and I found one application in this complicated overlay for other applications, so in the end I turned off only this application.

Screenshots:

Select apps choose configuration setting

choose to draw on top of other applications disable apps for the perpetrators

+5
03 Oct '16 at 7:53 on
source share

Get information from several answers here and in other forums.

Consolidating how I got rid of the problem:

  • Go to "Settings"> "Applications"> (your application becomes a problem).
  • Press the "Power" button until power on, reboot, flight mode.
  • Power off hold
  • Choose reboot in safe mode
  • Go to settings> apps> (your application that is becoming a problem)
  • Select required permissions
  • After updating Android M, problems can occur in applications such as Messenger, Whatsapp, Prisma, etc.

Let me know if you have any problems.

Note. I have One plus One mobile.

+3
Aug 01 '16 at 11:48 on
source share

I just uninstalled my application and disabled my Nexus 6P. After turning it back on, I reinstalled the application and no longer received “screen overlay” dialogs when granting application permissions.

+1
Sep 10 '16 at 15:18
source share

You must disable the overlay for all the applications that you see in the list. Only in this way can you change the permissions in the desired application. I did it in safe mode and it worked. In the end, I rebooted the phone and now it works fine.

0
Aug 22 '16 at 7:03
source share

I upgraded my Sony Xperia Z3 (Dual Sim) to Android 6.0.1 (Marsmallow). I had problems with the screen. For me, I don't have Clean Master, Du Speed ​​or Du Booster (as the solutions I read).

So, I decided that I was looking for any screen overlay application.

Screen Overlay Application is an application that you can use to access other applications on the main home screen without leaving the main screen. So for me, the Overlay Screen app here, in my situation, was OMNI SWIPE . Therefore, if you encounter this problem, you need to calm down and check which application is suitable for determining the screen overlay application.

Find the application and uninstall it, then restart the phone.

I just finished doing this and have a good time with the phone

Best of luck

0
Aug 22 '16 at 16:07
source share

While Android 6.x does not work on some devices, where this “overlay warning” is displayed for no reason (on 2-5% of devices according to my analytics data), the best solution is to avoid just allowing the process by pointing targetSdk to 22.

Make sure that you cannot lower the target sdk file for the new version, otherwise this will result in an INSTALL_FAILED_PERMISSION_DOWNGRADE error when the user updates, requiring an unisntall / install application.

0
Feb 15 '17 at 14:26
source share

decision

remove Toast messages from onRequestPermissionsResult method

0
Aug 21 '17 at 5:54 on
source share

This happens when you grant overlay permission to malicious applications. Go to the overlay settings and disable the overlay function in all applications that do not belong to Google, and everything will be fine.

0
Jan 16 '18 at 10:00
source share

This popup is caused by the manifest.PERMISSION.SYSTEM_ALERT_WINDOW declaration declared by the manifest.

These are 3 categories of permissions that a developer should know about:

Normal resolution - do nothing with them, just declare it in the Manifesto

Vulnerable permissions - declare in the manifest and request permission for the first time. They can be changed through the system settings.

Over dangerous permissions: SYSTEM_ALERT_WINDOW and WRITE_SETTINGS fall into this category. They should be provided, but not displayed in the system settings. To request it, you are not using the standard method (int checkSelfPermission (String permission)), but you should check Settings.canDrawOverlays () or Settings.System.canWrite () accordingly, and if you do not, you will get an exception, for example

Cannot add window android.view.ViewRootImpl$W@1de28ad - permission denied for this window type

1-Request this permission yourself in your code, as follows:

 public class MainActivity extends AppCompatActivity { public final static int REQUEST_CODE = 10000; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (checkDrawOverlayPermission()) { Toast.makeText(this, "Permission granted", Toast.LENGTH_SHORT).show(); } } public boolean checkDrawOverlayPermission() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { return true; } if (!Settings.canDrawOverlays(this)) { Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + getPackageName())); startActivityForResult(intent, REQUEST_CODE); return false; } else { return true; } } @Override @TargetApi(Build.VERSION_CODES.M) protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_CODE) { if (Settings.canDrawOverlays(this)) { Toast.makeText(this, "Permission granted", Toast.LENGTH_SHORT).show(); } } } 
0
May 22 '19 at 8:32
source share

I had a problem installing a new application. The way I ran into this problem is to manually allow permissions for a newly installed application (before launching the application). I am sure that this is a problem with Android and Samsung devices in particular. Hope this helps

-one
Apr 15 '17 at 17:24
source share
  • Remove apps that have a screen overlay, such as CM protection, Clean Master, etc.

  • If necessary, uninstall and try using Messenger (FB application).

-four
Jul 12 '16 at 17:21
source share



All Articles