[Bug][Android] DisplayAlert does not work with NavigationPage
See original GitHub issueDescription
DisplayAlert does not display a message when the MainPage is loaded in a NavigationPage.
Steps to Reproduce
- Create new MauiApp
- Change App.xaml.cs
MainPage = new NavigationPage(new MainPage());
- Change MainPage.xaml.cs: add line to method OnCounterClicked
DisplayAlert("Test", "Hello world!", "Ok");
Expected Behavior
Show message “Hello world!”
Actual Behavior
Message is not displayed.
Basic Information
- Version with issue: maui 6.0.101-preview.10.2068
- Last known good version: maui preview 9
- IDE: Visual Studio Professional 17.1.0 Preview 1.0
- Platform Target Frameworks: net6.0-android
- Android Emulator: API 30 and 31
Sample project
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Why DisplayAlert does not work in constructor?
The constructor simply creates a new Page class. CustomMainPage mainpage = new CustomMainPage(); (App.Current as App).MainPage = new ...
Read more >Xamarin.Forms 4.2.0.815419 (4.2.0 Service Release 2) ...
Release notes detailing new features, improvements, and issues fixed ... DisplayActionSheet or DisplayAlert in "OnAppearing" does not work ...
Read more >calling DisplayAlert from within a View Model?
Hi, A simple workaround is : Application.Current.MainPage.DisplayAlert(...). I use it in some of my view models and works fine, since Main Page ...
Read more >Xamarin.Forms/CHANGELOG and Xamarin.Forms Releases (Page ...
What's New in this Release. Shell. "[UWP] [Shell] Make Navigation and Transition overridable for Shell" (#12442); GitHub #6184 - "[Bug] Invalid TabBar.
Read more >Display Alert Not Close when you change Application ...
i see this problem when programming a application for customers kiosk ! we see some customers to forget click on exit button and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This appears to be fixed in Preview11. If you are still seeing this issue once Preview11 comes out please let me know and we can re-open
I am also experiencing the same issue.