This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void updateSetInPreferences(Context context, int appWidgetId, String key, String action) | |
{ | |
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); | |
SharedPreferences.Editor editor = prefs.edit(); | |
Set<String> storedSet, in; | |
switch(action) | |
{ | |
case ACTION_ADD_APP_WIDGET_ID: | |
storedSet = prefs.getStringSet(key, new HashSet<>()); | |
in = new HashSet<>(storedSet); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* fifteen.c | |
* | |
* Computer Science 50 | |
* Problem Set 3 | |
* | |
* Implements Game of Fifteen (generalized to d x d). | |
* | |
* Usage: fifteen d | |
* |