I'm navigating from one page to another page using the code
await Application.Current.MainPage.Navigation.PushModalAsync(new IntercomRecieveCallPage());
And from IntercomRecieveCallPage I'm navigating to IntercomCallPage using the Following code
await Application.Current.MainPage.Navigation.PushModalAsync(new IntercomCallPage());
And from IntercomCallPage I'm trying to do back navigation using the following code
await App.Current.MainPage.Navigation.PopModalAsync();
But I'm getting the following exception
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
I also tried PopAsync that is the following code
await App.Current.MainPage.Navigation.PopAsync(true);
for that also I get same exception. I tried to clear the navigation stack using the following code
Navigation.RemovePage(rootPage);
But still it doesn't help. I have no clue how to fix this. Any suggestions?