code: public static void remove(final String key) {
          SharedPreferences prefs = getPreferences();
          final Editor editor = prefs.edit();
          if (prefs.contains(key + LENGTH)) {
              // Workaround for pre-HC's lack of StringSets
              int stringSetLength = prefs.getInt(key + LENGTH, -1);
              if (stringSetLength >= 0) {
                  editor.remove(key + LENGTH);
                  for (int i = 0; i < stringSetLength; i++) {
                      editor.remove(key + "[" + i + "]");
                  }
              }
          }
          editor.remove(key);
  
          editor.apply();
      }
docs: Removes a preference value.
  
  @param key The name of the preference to remove.
  @see android.content.SharedPreferences.Editor#remove(String)