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

When I use google maps and location settings are disabled, I can click the gps icon. When I do this, I get this message on my device:

Use location? This application wants to change the settings of your device: Use GPS ...

This is a good alternative for this: https://hedgehogjim.wordpress.com/2013/03/20/programmatically-enable-android-location-services/

because the only thing the user needs is to select "Yes" or "No" and not understand the settings menu, change it and return to the application.

Like google maps, my app needs location data and I highly recommend using google maps features to bind to settings as described in the http link I posted here.

So how do I add this functionality to my application? In other words, how do you programmatically make this question pop up?

+3


source to share


1 answer


Take a look at the android-enabler API location settings: https://developers.google.com/android/reference/com/google/android/gms/location/SettingsApi . This link explains how to bring up a dialog box that allows the user to enable the desired location settings with a single click.



+4


source







All Articles