redth-org / AndHUD

Android Progress HUD and Dialog helpers for Xamarin.Android apps!
Apache License 2.0
180 stars 69 forks source link

Fix Redth/AndHUD#11 #23

Closed petersondrew closed 5 years ago

petersondrew commented 8 years ago

Check whether the attached context is finishing before attempting to dismiss the dialog and use null propagation to access the dialog, just in case there are any race conditions.

I ran into this issue when using aritchie/userdialogs in a xamarin forms app. If another activity has focus, such as the photo library, then the progress dialog seems to be unable to associate itself with our application's activity properly. When it is eventually dismissed the exception is thrown. There is an additional check to determine if the activity is already destroyed, but is only available in a higher API version.

P.S. Sorry about the whitespace differences

eatskolnikov commented 7 years ago

@Redth would you kindly merge this one? Is there any way we contributors can help you out to get this merged?

Cheesebaron commented 5 years ago

Fixed in https://github.com/Redth/AndHUD/commit/84c6c2ce9cf2f6fe74a0db71f85fd033f77ef8ea#diff-05d5dd85272d7cedb2e59ca16d832f52