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

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

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

4条回答
  •  生来不讨喜
    2020-12-05 18:05

    you can use

    Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS);
           startActivity(intent);
    

    after checking gps.

    complete source can be found HERE or you can refer to SO ANSWER

提交回复
热议问题