Search code examples
androidandroid-studiogpslocationgoogle-play-services

how to show location setting dialog in android?


From the google i/o 2015 I have learned that there is a new dialog in google play service where user doesnt need to exit the current app to turn on location. here is the image below that shows how it looks like:

enter image description here

now my question is, how can I implement this in my project? I have searched but didnt find any valid answer, please help!


Solution

  • Take a look at google service documetation for api's and you will find everything well documented. For your request i would suggest to use the LocationSettingsRequest.Builder to reach your goal.

    I have found an example by Kai in stackoverflow: Link