title: ListPreference: use string-array as Entry and integer-array as Entry Values doesn't work
body: <p>I'm using in a settings.xml file a ListPreference. I want to show the user a list of 3 options to select. When the user chooses one of the options in the Settings, I get this error:</p>
  
  <pre><code>java.lang.NullPointerException
      at android.preference.ListPreference.onDialogClosed(ListPreference.java:264)
      at android.preference.DialogPreference.onDismiss(DialogPreference.java:381)
      at android.app.Dialog$ListenersHandler.handleMessage(Dialog.java:1228)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:137)
      at android.app.ActivityThread.main(ActivityThread.java:4424)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:511)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
      at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>This is the code of the ListPreference:</p>
  
  <pre><code>&lt;ListPreference
      android:entries="@array/date_alignement"
      android:entryValues="@array/date_alignement_values"
      android:key="settings_date_alignement"
      android:summary="@string/settings_date_alignement_summary"
      android:title="@string/settings_date_alignement_title" /&gt;
  </code></pre>
  
  <p>And here are the arrays I use to populate the entries:</p>
  
  <pre><code>&lt;string-array name="date_alignement"&gt;
      &lt;item&gt;"Top"&lt;/item&gt;
      &lt;item&gt;"Center"&lt;/item&gt;
      &lt;item&gt;"Bottom"&lt;/item&gt;
  &lt;/string-array&gt;
  &lt;integer-array name="date_alignement_values"&gt;
      &lt;item &gt;0&lt;/item&gt;
      &lt;item &gt;1&lt;/item&gt;
      &lt;item &gt;2&lt;/item&gt;
  &lt;/integer-array&gt;
  </code></pre>
  
  <p>In my onSharedPreferenceChanged I use those values in this way:</p>
  
  <pre><code>@Override
  public void onSharedPreferenceChanged(
              SharedPreferences sharedPreferences, String key) {          
  
          //Text
          mAlignment =  mPrefs.getInt(PREF_ALIGNMENT, 1);
          switch (mAlignment) {
          case 0:
              offsetY = mHeight/3.0f;
              break;
  
          case 2:
              offsetY = mHeight*2.0f/3.0f;
              break;
  
          default:
              offsetY = mHeight/2.0f;
              break;
          }
  }
  </code></pre>
  
  <p>If I use another string-array for the <strong>entryValues</strong> it works. For example if I use the same string array as values and entries:</p>
  
  <pre><code>    android:entries="@array/date_alignement"
      android:entryValues="@array/date_alignement"
  </code></pre>
  
  <p>then I have to change my code a little but it works:</p>
  
  <pre><code>        if(mAlignment.equalsIgnoreCase("center")) {
              offsetY = mHeight/2.0f;
          } else if(mAlignment.equalsIgnoreCase("top")) {
              offsetY = mHeight/3.0f;
          } else if(mAlignment.equalsIgnoreCase("bottom")) {
              offsetY = mHeight*2.0f/3.0f;
          }
  </code></pre>
  
  <p>Why I can't use a string-array and an integer-array for a ListPreference entries and values?</p>