Android: when stop gps listener force close?

后端 未结 2 1358
被撕碎了的回忆
被撕碎了的回忆 2021-01-25 11:56

I got a force close when I tried to stop my gsp listener
Here\'s the code:

mlocManager.removeUpdates(mlocListener);
mlocManager = null;  

2条回答
  •  暖寄归人
    2021-01-25 12:01

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

    locationManager.removeUpdates(gpsl);
    

提交回复
热议问题