Having issues in android on logout flow

Hi,

I have a Xamarin forms app which is based on MasterDetailPage, whereas it's Detail is a TabbedPage.
When app loads I set the Main page as follows:

    MainPage = IsUserLoggedIn ? new MainPage() : (Page) new LogInPage();

Upon login everything works fine.

I've recently added a logout button located on MasterPage's Master, and handled it as follows (in LogOutPage):

    protected override void OnAppearing()
    {
        App.IsUserLoggedIn = false;

        App.Current.MainPage = new LogInPage();
    }

On iOS it works great, directing the user to the LogInPage.

However in Android I get the following error: (which refers to this line: 'App.Current.MainPage = new LogInPage();')

'Java.Lang.IllegalStateException: Recursive entry to executePendingTransactions'

I'll appreciate any help on that.

Best Answer

  • ofers77ofers77
    Accepted Answer

    I finally had this solved by upgrading both Android & Xamarin.Forms versions:
    Xamarin.Forms - 2.4.0.91020
    Xamarin.Android (all relevants) - 24.2.1

Answers

  • ofers77ofers77 Member
    Accepted Answer

    I finally had this solved by upgrading both Android & Xamarin.Forms versions:
    Xamarin.Forms - 2.4.0.91020
    Xamarin.Android (all relevants) - 24.2.1

Sign In or Register to comment.