diff --git a/app/src/main/java/eu/faircode/email/Widget.java b/app/src/main/java/eu/faircode/email/Widget.java index c675bb9845..424ecd1207 100644 --- a/app/src/main/java/eu/faircode/email/Widget.java +++ b/app/src/main/java/eu/faircode/email/Widget.java @@ -53,8 +53,8 @@ public class Widget extends AppWidgetProvider { NumberFormat nf = NumberFormat.getIntegerInstance(); for (int appWidgetId : appWidgetIds) { - long account = prefs.getLong("widget." + appWidgetId + ".account", -1L); String name = prefs.getString("widget." + appWidgetId + ".name", null); + long account = prefs.getLong("widget." + appWidgetId + ".account", -1L); boolean semi = prefs.getBoolean("widget." + appWidgetId + ".semi", true); List folders = db.folder().getNotifyingFolders(account); diff --git a/app/src/main/java/eu/faircode/email/WidgetUnified.java b/app/src/main/java/eu/faircode/email/WidgetUnified.java index 72b1d6bbda..b84cf4384a 100644 --- a/app/src/main/java/eu/faircode/email/WidgetUnified.java +++ b/app/src/main/java/eu/faircode/email/WidgetUnified.java @@ -38,6 +38,7 @@ public class WidgetUnified extends AppWidgetProvider { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); for (int appWidgetId : appWidgetIds) { + String name = prefs.getString("widget." + appWidgetId + ".name", null); long account = prefs.getLong("widget." + appWidgetId + ".account", -1L); long folder = prefs.getLong("widget." + appWidgetId + ".folder", -1L); String type = prefs.getString("widget." + appWidgetId + ".type", null); @@ -56,7 +57,6 @@ public class WidgetUnified extends AppWidgetProvider { if (!semi) views.setInt(R.id.widget, "setBackgroundColor", Color.TRANSPARENT); - String name = prefs.getString("widget." + appWidgetId + ".name", null); if (name == null) views.setTextViewText(R.id.title, context.getString(R.string.title_folder_unified)); else