Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

PushAsync is not supported globally on Android, please use a NavigationPage

$
0
0

Hi, I have seen this similar question asked before, however I seem to be experiencing something slightly different. I am trying to click a button on screen to navigate away from my Master Detail page, showing a new page with the default back button, in the nav bar, in the top left. So instead of the usual hamburger icon in the nav bar, it is the back button.

I have a Master Detail page that is set as the MainPage like so:
Application.Current.MainPage = new MainPage();

Reading elsewhere, all of the solutions I can find for this error is to change the above line to this:
Application.Current.MainPage = new NavigationPage(new MainPage());

I am using this code when the button is pressed to navigate away from my Master Detail page to the new page:
var masterDetailPage = Application.Current.MainPage as MasterDetailPage;
await masterDetailPage.Navigation.PushAsync(new NavigationPage(new ImageViewerPage(imagePaths, videoPaths)) { BarBackgroundColor = Color.FromHex("#3882cc") });

This would be fine except now I have two navigation bars on my Master Detail page, one that contains my hamburger (which is what I want) and another blank one (that I dont want). This is also the same on the page that I navigate to after pressing my button.

Many thanks for any help in advanced


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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