receive notification when current task ends
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().
精彩评论