Summary
In Android, developers can include two-state toggle switch widgets in their applications that allow users to select something between two options.
For more information, see here:
http://developer.android.com/reference/android/widget/Switch.html
Issue
This is a known regression in Android L; Android 5.0. If selected, the toggle widget will cause the app to crash.
Resolution
Though this has been fixed in Android 5.0.1, there is a workaround available for devices running Android 5.0 (which also works with lower versions of Android). Simply add the sample code below to the properties of your switch and it should no longer crash the overall application when selected at runtime.
Sample Code
android:thumb="@drawable/my_thumb_icon" android:track="@drawable/my_track_icon"
Keywords: Widget, Runtime Crashes, Regressions, 5.0.1
KB_0027