2010-05-26 75 views
0

我收到这样从我的GPS更新:手动中止GPS更新在Android中

lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 0, locationListener); 

在我onLocationChanged(位置LOC) - 方法我现在要放弃按特定标准更新GPS数据...

那么如何撤销/禁用requestLocationUpdates(...)?

尼斯的问候, poeschlorn

回答

1
+0

我的天啊,我怎么会如此盲目? ;-)非常感谢 – poeschlorn 2010-05-26 08:43:46

+0

我可以在onLocoationChanged()方法中使用它吗? lm.removeUpdates(this); – poeschlorn 2010-05-26 08:45:31

+0

是作为参数,您必须传递侦听器对象。在你的情况下,这应该是locationListener,只要我可以从你的代码中判断问题 – 2010-05-26 09:09:07