Android ToggleButton Tutorial
Android ToggleButton:
Android toggle button can be used to display checked/unchecked (On/Off) state on the button.
It is beneficial if user have to change the setting between two states. It can be used On/Off sound, Wifi, Bluetooth, etc.
Since, Android 4.0 there is another type of toggle called switch that provides slider control.
Android ToggleButton and Switch both are the subclasses of CompoundButton Class.
xml file:
Android toggle button can be used to display checked/unchecked (On/Off) state on the button.
It is beneficial if user have to change the setting between two states. It can be used On/Off sound, Wifi, Bluetooth, etc.
Since, Android 4.0 there is another type of toggle called switch that provides slider control.
Android ToggleButton and Switch both are the subclasses of CompoundButton Class.
xml file:
Activity file:
You can watch video demo here:
0 comments: