Custom SeekBar Preference

I just would like to share the code that I’ve posted in the Google Devs mailing list when someone asked about the SeekBar Preference. This allows you to popup a seekbar that you can use to adjust some properties like volume, difficulty and other things where a slider will be useful.

Then you can use it like:

and then can be added to a PreferenceScreen or PreferenceCategory