Hello everyone,
i'm currently fighting with a very strange behavior on Android devices. My app is developed with Xamarin Forms and should be available on iOS and Android. I'm using a Master-Detail-Layout and I have a Page which shows a list of sensors and if I click on one of them, then I want to open a page with detailed information about the sensor.
Therefore if you click on a cell, the following code is executed:
private void SensorsListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{
ISensor sensor = e.SelectedItem as ISensor;
if (sensor != null)
{
Navigation.PushAsync(new SensorDetailPage(sensor));
this.SensorsListView.SelectedItem = null;
}
}
This works perfect, it opens the DetailPage and everything works fine.
On the DetailPage I have a Button which does something and if it is successful it should return to the SensorPage (not the DetailPage). Therefore the following code is used:
private async void DoSomethingButtonPressed(object sender, SelectedItemChangedEventArgs e)
{
if (Sensor != null)
{
bool result = await DoSomethingCall(Sensor);
if (result)
{
await this.Navigation.PopAsync(true);
}
}
}
If I use await this.Navigation.PopAsync(false);
with animated=false, then everything works fine. But if I use animated=true, then it just opens a blank (black) view with no navigation bar, no status bar, nothing. If then the device is rotated (orientation is changed), then the screen I would expect is visible and it works, but not directly after the await this.Navigation.PopAsync(true);
.
I just tested it on Android with Android 5.0.2 and 4.4.2 on a Samsung SM-T230 and a Nexus 7 (ME370T) with Xamarin.Forms 1.4.3 and 1.5.0.
Does someone has an idea what's going wrong? or what I do wrong?
Thanks in advance.
Martin