Created
September 17, 2014 15:31
-
-
Save topgenorth/3fea57dd810a165bbfa5 to your computer and use it in GitHub Desktop.
Another way to check wait for Google Play Services & the map.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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