Exemplo n.º 1
0
        public void Start()
        {
            if (_broadcastReceiver == null)
            {
                // Create the broadcast receiver and bind the event handler
                // so that the app gets updates of the network connectivity status
                _broadcastReceiver = new NetworkStatusBroadcastReceiver();
                _broadcastReceiver.ConnectionStatusChanged += OnNetworkStatusChanged;

                // Register the broadcast receiver
                Application.Context.RegisterReceiver(_broadcastReceiver,
                                                     new IntentFilter(ConnectivityManager.ConnectivityAction));
            }
        }