Enable GPS programmatically Android (without navigating to the location settings)
问题 How to enable GPS programmatically, as it does happen in the official Google Maps app by just clicking on the 'turn on' option on the pop up screen (without navigating to location settings)? 回答1: The Google Maps app is using what is now available to us as SettingsApi the Play Services SDK. You can use SettingsApi to inquire as to whether your desired LocationRequest can be fulfilled with whatever location providers are enabled. If it cannot be fulfilled, and Play Services thinks that the user