From 18efd57c995728b26896b247d5d21f3a8589016e Mon Sep 17 00:00:00 2001 From: Juande Martos Date: Tue, 4 Apr 2017 00:29:52 +0200 Subject: [PATCH] This seems to fix #32 Symbol changes are not saving correctly to disk SharedPreferences. --- app/src/main/java/com/udacity/stockhawk/data/PrefUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/udacity/stockhawk/data/PrefUtils.java b/app/src/main/java/com/udacity/stockhawk/data/PrefUtils.java index 4e489b52..afab5fa9 100644 --- a/app/src/main/java/com/udacity/stockhawk/data/PrefUtils.java +++ b/app/src/main/java/com/udacity/stockhawk/data/PrefUtils.java @@ -39,7 +39,7 @@ public static Set getStocks(Context context) { private static void editStockPref(Context context, String symbol, Boolean add) { String key = context.getString(R.string.pref_stocks_key); - Set stocks = getStocks(context); + Set stocks = new HashSet<>(getStocks(context)); if (add) { stocks.add(symbol);