When ever I try to put an alert message on any page in my application, the application crashes just before displaying the alert in Xamarin.Forms.
async void OnAlertYesNoClicked (object sender, EventArgs e)
{
var answer = await DisplayAlert ("Question?", "Would you like to play a game", "Yes", "No");
}
Can somebody please suggest how to fix this issue?
Can you check to see that it's initialized? Also check the thread that is calling DisplayAlert to make sure it's the main thread. And just to be safe, are you able to change the async void to async Task?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With