Code example for AtomicBoolean

Methods: get

0
        @Override 
        public void onReceive(Context context, Intent intent) { 
            String action = intent.getAction(); 
            if (WifiManager.WIFI_STATE_CHANGED_ACTION.equals(action)) { 
                handleWifiStateChanged(intent.getIntExtra( 
                        WifiManager.EXTRA_WIFI_STATE, WifiManager.WIFI_STATE_UNKNOWN)); 
            } else if (WifiManager.SUPPLICANT_STATE_CHANGED_ACTION.equals(action)) { 
                if (!mConnected.get()) { 
                    handleStateChanged(WifiInfo.getDetailedStateOf((SupplicantState) 
                            intent.getParcelableExtra(WifiManager.EXTRA_NEW_STATE))); 
                } 
            } else if (WifiManager.NETWORK_STATE_CHANGED_ACTION.equals(action)) { 
                NetworkInfo info = (NetworkInfo) intent.getParcelableExtra( 
                        WifiManager.EXTRA_NETWORK_INFO); 
                mConnected.set(info.isConnected()); 
                handleStateChanged(info.getDetailedState()); 
            } 
        } 
    }; 
 
    public WifiEnabler(Context context, Switch switch_) {