question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug][Android] DisplayAlert does not work with NavigationPage

See original GitHub issue

Description

DisplayAlert does not display a message when the MainPage is loaded in a NavigationPage.

Steps to Reproduce

  1. Create new MauiApp
  2. Change App.xaml.cs MainPage = new NavigationPage(new MainPage());
  3. 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

MauiAppDA.zip

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
PureWeencommented, Dec 2, 2021

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

2reactions
mterhorstcommented, Nov 10, 2021

I am also experiencing the same issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found