Reputation: 645
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?
Upvotes: 9
Views: 14695
Reputation: 645
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.
Upvotes: 20
Reputation: 769
Or you can delay your code execution by using postDelayed
(new Handler()).postDelayed(new Runnable() {
@Override
public void run() {
// do something
}
}, 500); // it doesn't hurt to wait 500ms is it?
Upvotes: 1
Reputation: 5897
Here is your solution: https://gist.github.com/Aeonitis/2337b1ca652173839395be82db7d05c3
If you have any questions, let me know.
Upvotes: 1