Code example for Switch

Methods: isCheckedsetCheckedsetEnabled

0
                break; 
            case WifiManager.WIFI_STATE_DISABLED:
                setSwitchChecked(false); 
                mSwitch.setEnabled(true);
                break; 
            default: 
                setSwitchChecked(false); 
                mSwitch.setEnabled(true);
                break; 
        } 
    } 
 
    private void setSwitchChecked(boolean checked) {
        if (checked != mSwitch.isChecked()) {
            mStateMachineEvent = true;
            mSwitch.setChecked(checked);
            mStateMachineEvent = false;
        } 
    } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE