Skip to content
This repository has been archived by the owner on Nov 16, 2024. It is now read-only.

Commit

Permalink
Applying possible solution for undesired behavior.
Browse files Browse the repository at this point in the history
When a stock symbol is added or removed, the change is applied immediately to the current view, however, when the app is restarted, none of the previous changes in stock list SharedPreference exist.

Reported as issue udacity#32 on StockHawk repository.
"Symbol changes are not saving correctly to disk SharedPreferences"
Read for details: udacity#32
  • Loading branch information
bumxu committed Apr 4, 2017
1 parent b27ad6e commit 7dfcfb6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static Set<String> getStocks(Context context) {

private static void editStockPref(Context context, String symbol, Boolean add) {
String key = context.getString(R.string.pref_stocks_key);
Set<String> stocks = getStocks(context);
Set<String> stocks = new HashSet<>(getStocks(context));

if (add) {
stocks.add(symbol);
Expand Down

0 comments on commit 7dfcfb6

Please sign in to comment.