mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user