In our project we are using SwitchPreference similar to wifi settings.user can toggle value by clicking on toggle button and user can see more options by clicking on title.
But this is not working in lollipop. I can see some behaviour change in lollipop.
In kitkat:
When user taps on toggle button, onPreferenceChanged callback is called and when user taps on title, onPreferenceClicked is called.
In lollipop: you tap on toggle button or title onPreferenceClicked is called always and after that onPreferenceChanged is called. How can I get same behaviour in lollipop? This behaviour is breaking our functionality.
As a workaround I have created custom SwitchPreference class
It looks dirty but working for me.
I encounter same issue and I found this : https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&groupby=&sort=&id=172425
After some try, I found how to implement this workaround that work on my case :
Then you just have to use your own "MySwitchPreference" into SwitchPreference directly.