Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to fix screen overlay detected programmatically

In my app, I ask for permission to access SMS in Android SDK 23 (runtime permission) but the problem is dialog screen overlay showed up and access not granted .i disabled all another apps overlay but nothing changed. I found this link but not helped

and the question is how can I fix it programmatically?

like image 693
mR.Rian Avatar asked Aug 29 '16 07:08

mR.Rian


People also ask

Why is my phone saying Screen overlay detected?

If you see a 'Screen overlay detected' error (see example image below), it's caused by conflict between a running app and a newly installed app requesting permission to display info on multiple screens (e.g., messengers, alerts, battery status, etc.).

Why can't I turn off screen overlay?

Turn off screen overlay on Settings Just tap on the “OPEN SETTINGS” link to “Draw over other apps” page, which displays all the apps that are permitted to draw over other apps. You may have to disable the toggle on each app until the problem is fixed.


1 Answers

Ok,

finally I found the solution, I search all the web and can't find anything useful. The answer is: When you ask for new permission don't ever do something else like showing toast or.... In my case I restart my app and ask for the next permission I use this code for restart the app.

Good luck.

like image 150
mR.Rian Avatar answered Oct 12 '22 06:10

mR.Rian