Stop Location Listener in Android

前端 未结 5 594
小鲜肉
小鲜肉 2020-12-10 00:50

In my android app I need to get current GPS location of the user at the start of the application only if location has change from the previous location. But the problem is w

5条回答
  •  隐瞒了意图╮
    2020-12-10 01:41

    You can stop the LocationListener by making its object to null after stoping LocationListener locationManager.removeUpdates(mLocListener);, that is mLocListener = null; when you want it to stop fetching the Latitudes and Longitudes.

提交回复
热议问题