开发者

receive notification when current task ends

开发者 https://www.devze.com 2023-02-12 03:37 出处:网络
I\'m 开发者_开发知识库writing an android app where I\'d like to maintain the current location for the user while my app is open. I\'m trying to figure out how to know when to stop listening for update

I'm 开发者_开发知识库writing an android app where I'd like to maintain the current location for the user while my app is open. I'm trying to figure out how to know when to stop listening for updates from my LocationManager, but can't seem to figure out a good way to know when the current task is paused.

Is there an easy way to say something like onTaskFinish() or onTaskPause()?


When the application is paused the method onPause() gets called. That would be a good place to put it. The corresponding method called when the activity resumes is onResume().

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号