Skip to content

Instantly share code, notes, and snippets.

@topgenorth
Created September 17, 2014 15:31
Show Gist options
  • Save topgenorth/3fea57dd810a165bbfa5 to your computer and use it in GitHub Desktop.
Save topgenorth/3fea57dd810a165bbfa5 to your computer and use it in GitHub Desktop.
Another way to check wait for Google Play Services & the map.
var cancellation = new CancellationTokenSource();
Task.Run (async () =>
{
while (true)
{
await Task.Delay(100, cancellation.Token);
_map = _mapFragment.Map;
if (_map != null)
cancellation.Cancel();
}
}, cancellation.Token).ContinueWith(continuationTask => {
DisplayMap();
return;
}, TaskScheduler.FromCurrentSynchronizationContext ());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment