Code example for CheckBoxPreference

Methods: isChecked, setSummary

0
    } 
 
    private void handleStateChanged(NetworkInfo.DetailedState state) {
        // WifiInfo is valid if and only if Wi-Fi is enabled. 
        // Here we use the state of the check box as an optimization. 
        if (state != null && mCheckBox.isChecked()) {
            WifiInfo info = mWifiManager.getConnectionInfo();
            if (info != null) {
                mCheckBox.setSummary(Summary.get(mContext, info.getSSID(), state));
            } 
        } 
    } 
}