What would be the best way to display a dialog whenever my app receives some sort of notification from the android platform? e.g., orientation or the device language gets changed, etc..
The challenge for me is I don't know how to get the current activity context, so it's hard to use a AlertDialog.
Also, I want to show this dialog only if the app is running in the foreground, so my 2nd question is if there a reliably way to detect if the app is running in the foreground?
Thanks!