title: How to get an Android ListPreference defined in Xml whose values are integers?
body: <p>Is it possible to define a ListPreference in Xml and retrieve the value from SharedPreferences using getInt? Here is my Xml:</p>
  
  <pre><code>&lt;ListPreference android:key="@string/prefGestureAccuracyKey"
      android:title="@string/prefGestureAccuracyTitle" android:summary="@string/prefGestureAccuracyDesc"
      android:entries="@array/prefNumberAccuracyLabels" android:entryValues="@array/prefNumberAccuracyValues"
      android:dialogTitle="@string/prefGestureAccuracyDialog"
      android:persistent="true" android:defaultValue="2"
      android:shouldDisableView="false" /&gt;
  </code></pre>
  
  <p>And I want to get the value with something like: int val = sharedPrefs.getInt(key, defaultValue).</p>
  
  <p>At the moment I have to use getString and parse the result.</p>