enabling GPS programmatically not working

后端 未结 4 1178
生来不讨喜
生来不讨喜 2021-01-28 15:31

I am trying to enable/disable (toggle) GPS programmatically in my app via a button click, but it is not working. Please help. My target devices are not rooted.

Here\'s t

4条回答
  •  独厮守ぢ
    2021-01-28 16:04

    I am trying to enable/disable (toggle) GPS programmatically in my app via a button click

    This is not possible on modern versions of Android, for obvious privacy reasons.

    but it is not working

    There is no android.location.GPS_ENABLED_CHANGE action in the Android SDK. There is one used internally, but it merely announces a state change -- it does not actually change the state itself.

提交回复
热议问题