Alex Rivera | Logout

How to set the default value of the switch widget in android

Asked 2012-09-03T14:44:29.080
60

I am coding my xml file with the couple switch widgets. but I don't know how to set the default value of them as ON. And I just want to get this problem solved within the xml file so no Java.

Edit
Report

1 Answer

128

To make Switch set "ON" in you XML file use this:

android:checked="true" 
answered 2012-09-03T14:53:22.283

Your Answer