android how to stop gps

后端 未结 5 1271
无人共我
无人共我 2020-12-10 06:55

After launching listener by the following code is working fine.

LocationManager locationManager =(LocationManager) getSystemService(Context.LOCATION_SERVICE)         


        
5条回答
  •  -上瘾入骨i
    2020-12-10 07:29

    You need to pass the same object implementing LocationListener that you requested location updates for to the locationManager.removeUpdates() method.

    So in unless this and gpsl are one and the same, you should call:

    locationManager.removeUpdates(gpsl);
    

提交回复
热议问题