ToggleButton


 

  1. StaticToggleButton
  2. Dynamic ToggleButton

 

1. Static ToggleButton

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create “Blank Activity” and click “Finish” button.

Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open AndroidManifest.xml and add following code :

ScreenShot:

toggle toggle3 toggle2

Download SourceCode

 

2. Dynamic ToggleButton

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create “Blank Activity” and click “Finish” button.

Step 2 : Open src -> package -> MainActivity.java and add following code :

Step 3 : Open AndroidManifest.xml and add following code :

ScreenShot:

dy_togglebtn dy_togglebtn2 dy_togglebtn3

Download SourceCode