I have a preferences.xml which contains the following definition:
preferences.xml
The problem is that if putInt was never called then getInt will return a null value, even if you set a default integer value.
putInt
getInt
This seems to be a bug that was never fixed. So the solution is to call the putInt before calling getInt.