How to ask user to enable GPS at the launch of application?

前端 未结 5 776
我在风中等你
我在风中等你 2020-12-31 10:49
private void turnGPSOn(){
String provider = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);

if(!provider.contains(\"gps         


        
5条回答
  •  执笔经年
    2020-12-31 10:57

    use SettingsApi if you not want to force user to go settings page to enable gps. here the link of how to use SettingsApi SettingsApi

提交回复
热议问题