Code example for Switch

Methods: isChecked

0
        return true; 
    } 
 
    private void updateHardKeyboardEnabled() { 
        if (mHardKeyboardAvailable) {
            final boolean checked = mHardKeyboardSwitch.isChecked();
            if (mHardKeyboardEnabled != checked) {
                mHardKeyboardEnabled = checked;
                if (mHardKeyboardEnabledChangeListener != null)
                    mHardKeyboardEnabledChangeListener.onHardKeyboardEnabledChange(checked);
            } 
        } 
    } 
 
    public void openPanel() { 
        setVisibility(View.VISIBLE);
        updateUiElements(); 
        if (mInputMethodSwitchButton != null) {
            mInputMethodSwitchButton.setIconImage(R.drawable.ic_sysbar_ime_pressed);
        } 
    }