The problem is most likely caused by reusing the key, so the second assignment simply overwrites the same value.
One way to test this hypothesis is to try using simple keys that eliminate this possibility, for example:
editor.putInt("hour", hour); editor.putInt("min", min);
Alternatively, you can track the debugger, and the results of getString(keyId) can be compared.
If this really SavedStartSilentHour problem, make sure that the SavedStartSilentHour and SavedStartSilentMinute actually being evaluated for different lines - check the resource file itself.
source share