Code example for CompoundButton

Methods: getId, isChecked

0
            if (mCheckedId != -1) {
                setCheckedStateForView(mCheckedId, false);
            } 
            mProtectFromCheckedChange = false;
 
            int id = buttonView.isChecked() ? buttonView.getId() : -1;
            setCheckedId(id);
        } 
    } 
 
    /** 
     * <p>A pass-through listener acts upon the events and dispatches them 
     * to another listener. This allows the table layout to set its own internal 
     * hierarchy change listener without preventing the user to setup his.</p> 
     */ 
    private class PassThroughHierarchyChangeListener implements 
            ViewGroup.OnHierarchyChangeListener {
        private ViewGroup.OnHierarchyChangeListener mOnHierarchyChangeListener;
 
        /** 
         * {@inheritDoc}