fix snooze button in notifications

The "pref_snooze_interval" preference is manipulated by the ListPreference
class, which according to its docs stores the preference as a string.
Without reverting this part of 864636705d,
this results in "java.lang.ClassCastException: java.lang.String cannot be
cast to java.lang.Long" when trying to snooze a notification.
This commit is contained in:
Luboš Luňák
2017-09-12 15:50:42 +02:00
parent dccf5eae47
commit f52da56221

View File

@@ -142,7 +142,7 @@ public class Preferences
public long getSnoozeInterval()
{
return storage.getLong("pref_snooze_interval", 15L);
return Long.parseLong(storage.getString("pref_snooze_interval", "15"));
}
public String getSyncAddress()
@@ -313,7 +313,7 @@ public class Preferences
public void setSnoozeInterval(int interval)
{
storage.putLong("pref_snooze_interval", interval);
storage.putString("pref_snooze_interval", String.valueOf(interval));
}
public void setNumericalHabitsFeatureEnabled(boolean enabled)