Пример #1
0
        bool CheckWifi()
        {
            if (!Features.ConnectivityTester.HasWifi(this))
            {
                currentDialog = new Dialogs.NoWifiDialog(this);
                currentDialog.ShowUntil(() => Features.ConnectivityTester.HasWifi(this),
                async (res) =>
                { 
                    // Tapped on Retry
                    if (res)
                        await EstablishServer();
                },
                (res) =>
                {
                    // Tapped on "Open WLAN settings"
                    var wifiIntent = new Intent(Settings.ActionWifiSettings);
                    StartActivity(wifiIntent);
                },
                () => 
                {
                    currentDialog = null;
                }, false, "nowifi");

                return false;
            }

            return true;
        }
Пример #2
0
        protected override void OnStop()
        {
            DestroyServer();

            if (currentDialog != null)
            {
                currentDialog.Dismiss();
                currentDialog = null;
            }

            base.OnStop();
        }