Android Back Button Not Closing UI Overlay – Need Help!

Hello everyone,

I’m hoping someone can help me with this, please. When pressing the Android back button, my app closes as expected, but if a popup is open, it doesn’t close the popup first. I’m trying to toggle the visibility of the popup, which is a bunch of components under an overlay.

Here are my blueprints:

Thanks in advance!