Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在服务中使用位置侦听器,并且我已经覆盖了onLocationChanged(Location)方法。现在我希望每当第一次调用此方法时,我都想停止服务。所以请告诉我该怎么做
onLocationChanged(Location)
stopSelf从方法调用onLocationChanged(假设服务本身实现了该接口)。
stopSelf
onLocationChanged