Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • 3
    This is correct for a first-time prompt. However, my specific question is about what happens after the user fails to grant that permission (on purpose or by accident), and the app wants to help the user find the right permissions screen to grant the permission at a later time. This, as far as I can tell, is impossible to link directly. Commented Jan 18, 2021 at 19:16
  • What if you save the denied permission in the app as a SharedPreference, and later, if the user need the permissions, you check that preference, and if it was denied before, you open an intent to app permissions, using something like startActivity(new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, ...); Commented Apr 14, 2021 at 12:49
  • Yes, Luciano, this is exactly the approach my code takes as shown in the question. However, the settings landing screen for Settings.ACTION_APPLICATION_DETAILS_SETTINGS on stock Android is two levels up from where the background location permission needs to be granted. The problem is that many users never find it even when they want to. Commented Apr 15, 2021 at 17:33
  • Well, it is not the best solution, I am with this problem too. I have accessibility tools for blind users that need this permission, and now the flow for Android >= 11 has changed (they made it far more complicated by needing to give two permissions). I do not know if there is an alternative. Commented Apr 18, 2021 at 23:45
  • 2
    I've experience the item (2) and did not understand what was happening... Now I know I'm not the only one! Thank you!... As a side note I really think Google is messing things around lately. Commented Jun 9, 2021 at 10:39