0

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?

Elforama
  • 512
  • 1
  • 4
  • 16

1 Answers1

0

My method was working all along. The issue turned out to be a crash that I thought was happening when getting to the new screen. But it was happening before I even started it, and it stopped the destroy method from being called.

Elforama
  • 512
  • 1
  • 4
  • 16