I have a switch button (actually is a custom one) and I want to disable the swipe functionality for some reason; I want the user to be able to click it only. Is
switch
To disable a Switch use following method
switchBtn.setEnabled(false);
To make switch not clickable use
switchBtn.setClickable(false);
where switchBtn is Switch object