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

Why does setting Application.Current.MainPage while app is in the background not work in Android?

$
0
0

When running the following statement while the application is in the background on Android, the view will not change when coming back to the app.

Application.Current.MainPage = new xxxPage();

In iOS, this will correctly set the main page while the application is away. When the user comes back, it will be on the xxxPage. However, in Android, the line of code gets run. The type of Application.Current.MainPage changes to an xxxPage. But, the view/UI itself does not change. I tried wrapping it in a Device.BeginInvokeOnMainThread; that had no effect. Any thoughts? Is this a bug in Xamarin.Forms? Is this a limitation of Android?

For reference, I am testing on a tablet on Android 8.1.0 with Xamarin.Forms 4.1.0.555618.


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>