are there any situations where an Activity registered as a listener may be leaked due to onDestroy not being called?
Not that I can think of. However, that is not the same as:
Unregistering listeners in onDestroy - what's the harm?
The reason you unregister listeners in earlier lifecycle methods (e.g., onPause()
/onStop()
) is because the activity does not need those events when it is not in the foreground.
Your application already has to deal with the case where the activity is destroyed, such as by the user pressing the BACK button, but then the user later returning to the same spot in the app. You will need to create a new instance of the activity, and that activity instance will need to get whatever it needs to show from some data source. Hence, if that code works, you can use the same "get whatever it needs" logic to refresh an existing activity instance when it comes back to the foreground. IOW, treat a returning activity no different than a newly-created activity in terms of where you are getting your data.