I want the background to be clear.
Transparent? Yes, android has a color defined for this. You can access it:
@android:color/transparent
Or, in code:
Color.TRANSPARENT
@android:color/transparent is defined in res/values/colors.xml :
<color name="transparent">#00000000</color>
Alpha bits (first and second) are equal to zero.
But your definition for clear color:
<color name="clear">#ffffff00</color>
not transparent. You can render transparent like any color with its alpha set to zero . In your definition of clear alpha bits are full-blown to ff - 255 - opaque.
The definition of color gives the following:

Is there a way to save the switch and change the background color without pressing my own toggle button?
The thing is: the background color, and the switch is one extendable . The 'on' state is represented by one single possible, as well as the "off" state. You cannot just change color without losing toggle feedback. To change anything about ToggleButton's default background, you need to provide alternate drawings for each state.
I want the background to be clear, for example, in the default application for applications for the days of the week.
Setting the background to transparency will not work. I would advise you to study the source code and resources associated with creating ToggleButton . For example, the states on and off a ToggleButton represented by drawable resources. So, if you decide to change the background, you will need to provide ToggleButton at least two drawings: one for each state.
See how the default alarm clock app does it. Used ToggleButtons for days is defined as:
<ToggleButton android:layout_width="wrap_content" android:layout_height="48dp" android:layout_gravity="center" android:padding="0dp" style="@style/body" android:textColor="@color/clock_gray" **android:background="@drawable/toggle_underline"** android:clickable="false" android:singleLine="true"/>
Selectable toggle_underline is a state selector:
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:state_window_focused="true" android:drawable="@drawable/toggle_underline_activated"/> <item android:state_checked="true" android:drawable="@drawable/toggle_underline_activated"/> <item android:drawable="@drawable/toggle_underline_normal"/> </selector>
As you can see, if the ToggleButton parameter is set to on or checked (or when it is pressed ), then @drawable/toggle_underline_activated set to the background. Otherwise, @drawable/toggle_underline_normal is @drawable/toggle_underline_normal - the state is off .
toggle_underline_activated and toggle_underline_normal are graphical toggle_underline_normal with 9 patches.
toggle_underline_activated.9.png:

toggle_underline_normal.9.png:

You can get these drawings (and more) here: Link .
Thus, you can either create your own 9 patch panels with a transparent background, or use them with the state selector, or you can look at the default project for the alarm clock and use the drawings from its drawable-XXXX folders.