I have implemented ActivityLifecycleCallbacks
in a private class inside my Application
class.
If Home button or Back button is used, lifecycle's onStop()
and onPause()
methods are getting called. If I kill the activity by swiping out from background, onDestroy()
method is not getting called. It gets called when I start my activity next time. I am using moveTaskToBack(true)
in case of Back press.
What must be the issue and which lifecycle method should get called when we swipe out from background?