Is there a way to check if the activity exists on android side of Xamarin.Forms so that calling DisplayAlert doesn't crash like this:
Java.Lang.RuntimeExceptionAttempt to invoke virtual method 'android.content.res.Resources$Theme android.content.Context.getTheme()' on a null object reference
This seems to happen when they user backgrounds the app or something when a DisplayAlert would have shown. On android proper you'd check if the activity is available.
Do I need to write an Android DependencyService to check this or is there a way to do it in Xamarin.Forms?
Thanks