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.

The back button still enable when LoadingDialog is showing

See original GitHub issue

Describe the bug When the LoadingDialog is showing the back button press will go to last page.

To Reproduce Steps to reproduce the behavior: Here‘s two page :

public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private async void Button_Clicked(object sender, EventArgs e)
        {
            View1 view1 = new View1();
           await Navigation.PushModalAsync(view1);
        }
    }
public partial class View1 : ContentPage
    {
        public View1()
        {
            InitializeComponent();
        }

        private async void Button_Clicked(object sender, EventArgs e)
        {
            var dialog = await MaterialDialog.Instance.LoadingDialogAsync(message: "获取数据中……");
            await Task.Delay(5000);
            dialog.Dispose();
        }
    }

When the loadingdialog is showing,I press back button on android,it back to MainPage, but the loadingdialog still showing,after 5s loadingdialog hide.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11

github_iconTop GitHub Comments

2reactions
contrix09commented, Dec 20, 2018

Hi, did you override the OnBackPressed on Android like this:

public override void OnBackPressed()
{
    XF.Material.Droid.Material.HandleBackButton(base.OnBackPressed);
}
0reactions
vincywindycommented, Dec 20, 2018

I override it,it works fine,thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Back Button and Progress Dialog
I have an AsyncTask that shows a progressDialog whilst working (it calls runOnUiThread from within doInBackground to show the progress dialog).
Read more >
Will it ever be okay for web-apps to disable the back-button?
Disabling the back button is generally just a way to cover for bad design and/or bad programming, where things go wacky if you...
Read more >
Dialogs | Android Developers
A dialog that can show a title, up to three buttons, a list of selectable items, or a custom layout. DatePickerDialog or TimePickerDialog:...
Read more >
How to enable back button in android webview
This example demonstrate about How to enable back button in android webview. Step 1 − Create a new project in Android Studio, go...
Read more >
How To Enable The BACK Button On Your Android ... - YouTube
How To get The BACK Button On Your Android Phone Quickly & Easily if the navigation buttons are turned off. Follow These Simple...
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