From 8ce3b7c7ce3e1ffc539e6ca45fa2d035922ee5e5 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 3 Oct 2023 22:07:31 +0200 Subject: [PATCH] Fixed import cast error --- .../main/java/eu/faircode/email/FragmentOptionsBackup.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsBackup.java b/app/src/main/java/eu/faircode/email/FragmentOptionsBackup.java index 50f92b1bbe..37eef38a4f 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsBackup.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsBackup.java @@ -1202,6 +1202,8 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere case "float": if (value instanceof Double) editor.putFloat(key, ((Double) value).floatValue()); + else if (value instanceof Integer) + editor.putFloat(key, ((Integer) value).floatValue()); else editor.putFloat(key, (Float) value); break; @@ -1220,7 +1222,9 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere editor.putInt(key, i); } else if (value instanceof Long) editor.putLong(key, (Long) value); - else if (value instanceof Float || value instanceof Double) + else if (value instanceof Double) + editor.putFloat(key, ((Double) value).floatValue()); + else if (value instanceof Float) editor.putFloat(key, (Float) value); else if (value instanceof String) editor.putString(key, (String) value);