How to enable gps in Android

前端 未结 2 1647
灰色年华
灰色年华 2021-01-07 01:45

How to open the gps in Android when it is closed to retrieve the current position. I test two method

private void turnGPSOn(){
    String provider = Settings         


        
2条回答
  •  我在风中等你
    2021-01-07 02:16

    It's inappropiate to enable GPS from the code. You can't fo that.

    There used to be an exploit that allowed the GPS to be turned on by an app with no special permissions. That exploit no longer exists as of 2.3 (in most ROMs).

提交回复
热议问题