Android Switch widget textOn and textOff not working in Lollipop

Text is not shown by default under Material theme since the switch widget assets don't work well with text. Any text that you do set will be used to describe the content to accessibility services.

You can change this using the android:showText property or Switch.setShowText(boolean) method.

    android:showText="true" />

If you are using AppCompat switches, use app:showText instead.