title: Get keyValue from ListPreference
body: <p>Following problem:</p>
  
  <p><code>preferences.xml</code>:</p>
  
  <pre><code>    &lt;ListPreference
          android:title="titel"
          android:summary="summary"
          android:key="remove_onclick"
          android:entries="@array/removeOnclick"
          android:entryValues="@array/removeOnclick_value"
          android:defaultValue="3"/&gt;
  </code></pre>
  
  <p>My question is, <strong>how I can get the Value (<code>1</code>, <code>2</code>, or <code>3</code>) to use it with an if-condition in my MainActivity.java</strong></p>
  
  <pre><code>    SharedPreferences sharedConfig = PreferenceManager.getDefaultSharedPreferences(this);
      String removeOnklick = sharedConfig.getString("remove_onclick", "3");
  </code></pre>
  
  <p>This does not work!</p>
  
  <blockquote>
    <p>Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be
    cast to java.lang.String at
    com.notification.app.SettingsActivity.onCreate(SettingsActivity.java:14)</p>
  </blockquote>
  
  <p>SettingsActivity:</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState){
      super.onCreate(savedInstanceState);
      addPreferencesFromResource(R.xml.preferences);
      PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
   }
  </code></pre>
  
  <p>EDIT
  <code>strings.xml</code></p>
  
  <pre><code>&lt;string-array name="removeOnclick"&gt;
      &lt;item&gt;Always&lt;/item&gt;
      &lt;item&gt;Never&lt;/item&gt;
      &lt;item&gt;Always ask&lt;/item&gt;
  &lt;/string-array&gt;
  
  &lt;string-array name="removeOnclick_value"&gt;
      &lt;item&gt;1&lt;/item&gt;
      &lt;item&gt;2&lt;/item&gt;
      &lt;item&gt;3&lt;/item&gt;
  &lt;/string-array&gt;
  </code></pre>
  
  <p>And I also have 2 booleans which work perfectly.</p>
  
  <pre><code>    boolean playSound = sharedConfig.getBoolean("sound_on_create", false);
      boolean vibrate = sharedConfig.getBoolean("vibrate_on_create", false);
  </code></pre>
  
  <p>Update:</p>
  
  <p>I just had to delete the cache and the memory...</p>