Home > OS >  How do I start a page with a function always in C# xamarin forms android?
How do I start a page with a function always in C# xamarin forms android?

Time:08-24

I'm trying to start a Page using a function always. How could I do that? Because the first time works perfectly but the second it does't work.

Here is some content about my app.

  1. homePage
  2. ScanQRPage

So, basically I have a button in homePage that redirect to ScanQRPage. And there I have this constructor

public ScanQRPage()
    {
        InitializeComponent();
        btnScannerQR.IsVisible = true;
        Connectivity.ConnectivityChanged  = ConnectivityChangedHandler;

        Scanner();
    }

And what I need is that every time the user go to this page (ScanQRPage), the Scanner function start.

How could I do that?

Thank you very much!

CodePudding user response:

use OnAppearing

protected override void OnAppearing()
{
    Scanner();
}
  • Related