Search Posts

Tag: http

Solve Android.OS.NetworkOnMainThreadException

Background Working with Xamarin.Android (or Xamarin.Forms with Android) you might encounter this error when making HTTP/REST calls to an API, even if you think your making the call async. So what’s up with that? The Culprit What can commonly happen is you got some nested async call like this (simplified):

While Login will begin to execute async and the nested call to Authenticate (signature async Task<TokenResponse>) will also do so the assignment to this.TokenResponse (a […]