Android Question Switch ON / OFF Button example

Richard Goh

Active Member
Licensed User
Longtime User
Hi, I would like to create a switch On/Off type of button. eg. swap right to on and left to off. But don't really know how to do it. Is there any example or sample code available? Thank you.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

mangojack

Well-Known Member
Licensed User
Longtime User
Something very basic ... 2 labels and LongClick .. food for thought anyway lol

On a serious note regarding the O and | , would you not confuse users.. I thought it was "O" (Zero) for Off and "l" (One) for On ??
 

Attachments

  • Toggle Button Sample.zip
    7.2 KB · Views: 856
  • Toggle Button.PNG
    Toggle Button.PNG
    2 KB · Views: 679
Upvote 0

Richard Goh

Active Member
Licensed User
Longtime User
Thanks
Something very basic ... 2 labels and LongClick .. food for thought anyway lol

On a serious note regarding the O and | , would you not confuse users.. I thought it was "O" (Zero) for Off and "l" (One) for On ??
Hi mj. thanks. my wrong interpretation.
 
Upvote 0
Top