I hesitated to ask this question as I don't have code blocks to show. The problem is more conceptual.
I have a baseActivity that handles my ActionBar. The baseActivity is inherited across most Activities so that my ActionBar is accessible from everywhere. The app itself is a shopping app and one of the buttons on the Actionbar is set to "View shopping cart" which is an Activity in a Dialog theme so it looks like a popup over whatever Activity was running when the user pressed the button.
Within the cart, I want to have buttons to give the user quick access to add new items in the catalog. Press a button, start the catalog and let the user shop. That all works fine.
The problem is that if the catalog was the current activity when the dialog was invoked, I'd like to simply dismiss the dialog and go back to the catalog - otherwise, I have one instance of the catalog running and pressing the button causes another instance.
Is it possible to determine what activity was active when a dialog was invoked from the actionbar?