How do I programmatically enable the the "Use location?" message in Android?


Staff member
When I use google maps and have the location settings disabled, I can press the gps icon. When I do this, I get this question message on my device:

Use location? This app wants to change your device settings: Use

This is a nice alternative for this:
<a href="" rel="nofollow"></a>

because the only thing the user needs to do is select "Yes" or "No" instead of understanding the settings menu, changing it and going back to the app someway.

Like google maps, my app needs location data as well and I strongly prefer the google maps functionality over linking to the settings as described in the http link I posted here.

So how do I add this functionality to my app? In other words, how do I programmatically ensure this question pops up?