Check for isFinishing flag before showing dialog

Hi there! It occurred to me that it would be great to check that activity is still running before showing the dialog.
Please find my implementation below.