Issue
I have such a method implementation and I want to understand what will happen when this method is called. Could you give me a hint
override fun onDestroy() {
Timber.d("$this: onDestroy")
stopSelf()
super.onDestroy()
}
Solution
onDestroy() should only be called by Android when the Service has already stopped. Android won't call onDestroy() if the Service is running. If you call stopSelf() in onDestroy() it should just do nothing, as the Service is already stopped.
Answered By - David Wasser
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.