Forum Xamarin.Forms

Navigation doesn't works everywhere but on Android 9.0

LiqwidLiqwid Member ✭✭

I am trying to navigate with the following code. It works on iOS, Oreo, and KitKat, but not Pie. I have confirmed this with the emulator and a real device.

MainThread.BeginInvokeOnMainThread( () => Application.Current.MainPage = new MainPage() );

All I get is a white screen indicating a deadlock. If I remove the BeginInvokeOnMainThread() it works on Pie but not iOS.

I know best practice is to always perform UI tasks on the main thread, but am at a loss as to why this is happening. Anyone have any ideas?


  • LandLuLandLu Member, Xamarin Team Xamurai

    I've tested it on my Pie simulator it works well. Can you provide your sample to help me reproduce your issue on my side?
    And I totally agree with what you said about UI tasks should be performed on the main thread.

Sign In or Register to comment.