How to prompt user to enable GPS_PROVIDER and/or NETWORK_PROVIDER?

前端 未结 4 1955
死守一世寂寞
死守一世寂寞 2020-12-05 17:54

I need to get location of user. I put in manifest

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 18:18

    You can start an options intent for the location settings.

    Intent gpsOptionsIntent = new Intent(  
        android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);  
    startActivity(gpsOptionsIntent);
    

提交回复
热议问题