How to make it so that when you click on the Switch, it does not switch, but the click was perceived by him? Since the dialog is assigned by pressing
1 answer
Just make the switch inactive and hang a click listener on it.
switch.setEnabled(false); switch.setOnClickListener(...); - And if I use the same onClick in the markup, it will not work, it turns out? - turok09
- Then just remove the second line from the answer. - Yuriy SPb ♦
- If you remove, then when you press the switch, nothing happens - turok09
- 2Then leave ... - YuriySPb ♦
- one@ YuriySPb Schrödinger - Silento
|
Switchthat does not switch, use the button with the switch background instead. - Vladyslav Matviienko