title: Add SeekBar to SettingsActivity
body: <p>I want to add SeekBar to SettingsActivity by adjusting which I can save the value to a variable. I tried different ways, but I couldn't do it right with any of them.</p>
  
  <p>My default SettingsActivity:</p>
  
  <pre><code>class SettingsActivity : AppCompatActivity() {
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.settings_activity)
          supportFragmentManager
              .beginTransaction()
              .replace(R.id.settings, SettingsFragment())
              .commit()
          supportActionBar?.setDisplayHomeAsUpEnabled(true)
      }
  
      override fun onOptionsItemSelected(item: MenuItem): Boolean {
          when (item.itemId) {
              android.R.id.home -&gt; {
                  finish()
                  return true
              }
          }
          return super.onOptionsItemSelected(item)
      }
  
      class SettingsFragment : PreferenceFragmentCompat() {
          override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
              setPreferencesFromResource(R.xml.root_preferences, rootKey)
          }
      }
  }
  </code></pre>
  
  <p>And my root_preferences.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"&gt;
      &lt;PreferenceCategory
          app:iconSpaceReserved="false"
          app:title="@string/title_activity_settings"&gt;
          &lt;SeekBarPreference
              android:defaultValue="40"
              android:key="shuffle_steps_key"
              android:max="100"
              android:summary="summary"
              android:title="title"
              app:defaultValue="true"
              app:iconSpaceReserved="false"
              app:min="10"
              app:showSeekBarValue="true"
              tools:ignore="UnusedAttribute" /&gt;
      &lt;/PreferenceCategory&gt;
  &lt;/PreferenceScreen&gt;
  </code></pre>
  
  <p>P.S. I tried to insert <code>&lt;Preference android:layout="@layout/sliderlayout" /&gt;</code> to root_preferences.xml and add code at onCreate of SettingsActivity, but have crash of app</p>