Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Exception when setting the source for an Image (Android)

$
0
0

When trying to bind an Image to its source using

previewImage.SetBinding (Image.SourceProperty, "ImageUrl");

or

previewImage.Source = source;

it throws an exception:

[mono] Unhandled Exception:
[mono] System.InvalidOperationException: The underlying Task is already in one of the three final states: RanToCompletion, Faulted, or Canceled.
[mono] at System.Threading.Tasks.TaskCompletionSource`1[System.Int32].ThrowInvalidException () [0x00000] in :0
[mono] at System.Threading.Tasks.TaskCompletionSource`1[System.Int32].SetException (IEnumerable`1 exceptions) [0x00000] in :0
[mono] at System.Threading.Tasks.TaskCompletionSource`1[System.Int32].SetException (System.Exception exception) [0x00000] in :0
[mono] at System.Threading.Tasks.TaskFactory`1[System.Int32].InnerInvoke (System.Threading.Tasks.TaskCompletionSource`1 tcs, System.Func`2 endMethod, IAsyncResult l) [0x00000] in :0
[mono] at System.Threading.Tasks.TaskFactory`1+c__AnonStorey5`3[System.Int32,System.Byte[],System.Int32,System.Int32].<>m__0 (IAsyncResult l) [0x00000] in :0
[mono] at System.Net.SimpleAsyncResult+c__AnonStorey0.<>m__0 (System.Net.SimpleAsyncResult result) [0x00000] in :0
[mono] at System.Net.SimpleAsyncResult.DoCallback_internal () [0x00000] in :0
[mono] at System.Net.WebAsyncResult.DoCallback () [0x00000] in :0
[mono] at System.Net.WebConnectionStream.ReadCallbackWrapper (IAsyncResult r) [0x00000] in :0

ImageUrl and source are System.String objects, and the content is a HTTP URL


Viewing all articles
Browse latest Browse all 58056

Trending Articles