When a user logs out in my app I want to take them to the login screen and clear the current stack. To do this I call this code with my intent, and it works:
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
However, none of my fragments or activities that are being cleared have their destroy methods called. How do I get these methods called?