Code example for Switch

0
 */ 
public class SwitchBtn extends Switchable<Switch> { 
 
    public SwitchBtn(Context c) { 
        super(c); 
        switchBtn = new Switch(c); 
    } 
 
 
    @Override 
    public void setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener oc) { 
        switchBtn.setOnCheckedChangeListener(oc); 
    } 
 
    @Override 
    public void setChecked(boolean b) { 
        switchBtn.setChecked(b); 
    } 
 
 
}