I want to create slide switch for example(on/off) currently shows on if i slide to off will enable and also know which status is currently shows pls help me.
Asked
Active
Viewed 2,015 times
2 Answers
0
Use Switch and its setOnCheckedChangeListener and a OnCheckedChangeListener(CompoundButton buttonView, boolean isChecked), that gets called whenever the switch is touched, and check the value of isChecked to know the state of the switch. This also applies to ToggleButton; check the Tutorial on both of them for more information. (I think Switch is only available from Android 4.0 on)

Moises Jimenez
- 1,962
- 3
- 21
- 43
-2
You can use ToggleButton There is more information about ToggleButton

Sardor Dushamov
- 1,665
- 3
- 17
- 44
-
ToggleButton shows only one state if we click changes,but i want both on/off should visible and highlight only selected item using slide – Vicky Oct 10 '12 at 07:58
-