code: public static Editor clear() {
          final Editor editor = getPreferences().edit().clear();
          editor.apply();
          return editor;
      }
docs: Removed all the stored keys and values.
  
  @return the {@link Editor} for chaining. The changes have already been committed/applied
  through the execution of this method.
  @see android.content.SharedPreferences.Editor#clear()