Posted inAndroid
Android Tip – How to define Getter/Setter methods?
Hello All, This is actually a tip to define Getter/Setter methods in easy way. In other terms you can say Object initialization. You know why i thought to share this…
Step 1: Create 2 images for ON and OFF state of toggle button, place these 2 images inside the Drawable folder. FYI, i have used 9-patch tool to create images for the states.
Step 2: Now, create a selector file for your toggle button, which is used to get state of button and define drawable accordingly.