I\'m having a problem with a listener in a certain activity.
The problem is that this listener contains an alert.show(); which can be called after we try to push a
This happens when the Activity will be going through its destruction when the background thread finishes its work and tries to show a Dialog.
This exeption is rare to reproduce but happens when we do some async task / background operation and want to display a dialog with Activity context and in the mean while our activity is destroying itself due to some reason.
Android OS should handle this situation, but as of now it does not.
so before calling your dialog just check if activity is running and not in its destruction phase.
if(!isFinishing()){
callDialog();
}