I feel like I'm missing something, as I've seen many, many suggestions of using
Task.Delay(ms) for waiting in a mobile application. However, this is dangerous, at least it certainly is on Android, as there is no way to pause that wait should the OS interrupt your Activity to take a phone call or something. If that happens, the delay keeps happily ticking along, returning into a method that is now paused with a view that's been disposed. Sure, I could check for if the state has been saved or something after every single delay, but that feels like a hack and makes me think I must be doing something wrong.
tl:dr I'm making a game, I need to wait on occasion to allow animations and such to play out and let the player sit for a second or two, and I need to be able to pause this delay if
OnPause() is called, resume the delay when
OnResume() is called, and pick up where I left off. Is there no safe way to do this seemingly simple task using Xamarin.Android?
Task.Delay(ms) works astoundingly well unless the OS interrupts my app and then everything falls apart.``