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

Problem with PushAsync "from time to time"

$
0
0

Hello,
In my app, the main screen is some kind of "launcher" which 4 main buttons that each "PushAsync" another view (from which the user can then only go back to the main screen, the views cannot go to each other directly, so it should actually be very simple).
This works flawlessly on WinPhone and iOS, but on Android after a few times going to a different view and coming back to the main screen, the PushAsync starts acting funny.

I ended up adding some "logging" at the point where I push my views:

        Debug.WriteLine ("Pushing view: " + view.Title);
        Debug.WriteLine ("views on stack before push: " + Navigation.NavigationStack.Count);
        await Navigation.PushAsync(view);
        Debug.WriteLine ("views on stack after push: " + Navigation.NavigationStack.Count);

Normally for every PushAsync I get a "before"-value of 1, and an "after"-value of 2 (normal because the bottom element in the stack is the main navigation page itself)

As said, this works flawlessly on WinPhone and iOS (after going back and forth to the different views for dozens of times). But on Android, after a few times going to the different views (at most two times for each view), suddenly the navigation doesn't work anymore. I press a button to go to a view, and I see in my debug output that the "before"-value is 1, but the "after"-value doesn't show up. So it's seems like it hangs on the "await". So at that point, I'm still at the main screen, and if I then press another button, I get the "before"-value of 2 , an "after"-value of 3, and the screen turns black.

If i use the AsyncModalPush, I don't get this problem, but I really need the modeless view instead of modal.

Is this a known issue on Android ? After some googling I found that there (used to be) some problems with PushAsync "not globally supported" on Android ?

Kind regards,
Sven.


Viewing all articles
Browse latest Browse all 77050

Trending Articles