Forum General


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

ActivityTask: A Helper for Async/Await on Android

JeremieLavalJeremieLaval USXamarin Team Xamurai

September 25, 2017 - ActivityTask: A Helper for Async/Await on Android


  • MarkAdamsonMarkAdamson USMember ✭✭

    Very nice! This is one of the pain points I have hit with my first Xamarin app. I'm currently attempting to change my UI to use Xamarin.Forms instead of Android and this was one of the motivations.

    Is this relevant for Xamarin.Forms? I'm not experienced with it enough yet to figure it out

  • MarkAdamsonMarkAdamson USMember ✭✭

    I should add that my app is only for Android and is likely to stay that way. I'm mainly switching to Xamarin.Forms because it feels much nicer! (coming from WPF anyway)

  • PaulKiarPaulKiar USMember ✭✭

    Xamarin.Forms has the same issue with Illegal state exception and async calls, I was hoping that there was an example for using this in Forms.

  • MarkAdamsonMarkAdamson USMember ✭✭
    edited October 2017

    @JeremieLaval Hi Jeremie, I'm trying to figure out how to use this to implement StartActivityForResult without needing all the recoding in the ActivityController. Do you think it's possible? The main issue seems to be that ActivityTask is a replacement for Task and not Task< T >, but I may be misunderstanding the subtleties. The code looks very clever.

  • MarkAdamsonMarkAdamson USMember ✭✭

    I've ended up resorting to the Fragment trick used from Adam Kemps blog instead (can't post links yet). I hope that it deals with the funny cases that you are dealing with too. It would be nice to have a more standard approach that we could use with xamarin.

Sign In or Register to comment.