According to references, ToggleButtons and Switches are supposed to be used with an OnCheckedChangeListener or with a function like onToggleClicked(View view).
Those are event listeners, if you need to take immediate action based upon the change of the state of the compound button, such as enabling/disabling other widgets. They are not needed otherwise.
What is the proper way to handle this situation?
Call isChecked()
on each CompoundButton
(whether ToggleButton
or Switch
or CheckBox
or whatever), and use that information to "affect a calculation".