In my app, I have the values like:
<ListPreference
android:key="font_setting"
android:title="@string/font"
android:summary="%s"
android:entries="@array/font_list"
android:entryValues="@array/font_list_values"
android:dialogTitle="@string/choose_font" />
and the data:
<string-array name="font_list">
<item>"Small"</item>
<item>"Medium"</item>
<item>"Big"</item>
</string-array>
<integer-array name="font_list_values">
<item>1</item>
<item>2</item>
<item>3</item>
</integer-array>
but when I choose one value, the app crashes, there is error:
java.lang.NullPointerException
at android.preference.ListPreference.onDialogClosed(ListPreference.java:264)
I found this is actually a very old issue raised here. And surprisingly, Google just said it is not a bug and there is no fix? Anyone has suggestions?
This is tested in Android version 4.0.