code: @TargetApi(Build.VERSION_CODES.HONEYCOMB)
      public static Set<String> getStringSet(SharedPreferences preferences,
              String key, Set<String> defaultValue) {
          Set<String> result = defaultValue;
          if(supportsStringSet()) {
              result = preferences.getStringSet(key, defaultValue);
          } else {
              String serializedSet = preferences.getString(key, "");
              // Don't use String.isEmpty() - it's only available in API 9 and
              // greater and we want to support 8
              if(serializedSet.length() > 0) {
                  result = new HashSet<>(Arrays.asList(
                              serializedSet.split(",")));
              }
          }
          return result;
      }
docs: Retrieve a set of strings from SharedPreferences, using the built-in
  getStringSet method if available and falling back to a comma separated
  String if not.
  
  Note that this is a simple approach that won't work if the values in the
  set contain commas.
  
  @param preferences the SharedPreferences to retrieve the set from.
  @param key the key for the preference.
  @param defaultValue the default value to return if the preference is not
  stored.
  
  @return The set if found, otherwise the default value