title: Which lifecycle event is best to register/unregister listeners?
body: <p>I have manager classes that take an activity as a listener. I use the managers to do threaded calls, work etc and then call back to the listener(activity) when things are done, need changed and so on.</p>
  
  <p>I want to register and unregister the activity as a listener when it is no longer visible. This will prevent unwanted changes from happening (like dialogs appearing when the activity is no longer visible).</p>
  
  <p>My question is, what lifecycle events are best to do this registering. I started with onPause() and onResume() which worked well except when I had an activity that was doing stuff in onActivityResult(). Since onActivityResult() gets called before onResume() my managers are not always registered in time.</p>
  
  <p>Do I need to register in onResume() AND onActivityResult() or is there a better way to approach this? </p>