I have a switch in one of my activities and when the user interacts with it in any way a method called onSwitchClick
should be executed. Currently, the function executes when the switch is tapped (both from the on and off positions), but never when the switch is "dragged" from one position to the other with a movement of the finger. However, I know the switch's state is being set because another method which turns it off at certain instances does work normally.
Portion of the relevant layout code that formats the activity.
<Switch
android:id="@+id/switch_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onSwitchClick"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="@string/switch_text" />