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:
This is a known regression in Android L; Android 5.0. If selected, the toggle widget will cause the app to crash.
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.
Keywords: Widget, Runtime Crashes, Regressions, 5.0.1