Android Tutorial #32:Settings Page (6/7) Detect and handle switch button programatically

Опубликовано: 02 Май 2026
на канале: clientuser.net
1,326
2

Source Code:   / clientuser_net  

We go over how to detect and handle an android switch button programatically. To confirm this, we use a couple of toasts to echo out a message depending on the state that we set the switch.

We also store a boolean value in the application class so that our app can remember the choice the user has made for the switch button., much like we did in the sound pool radio button example.