code: public static double getDouble(@NonNull SharedPreferences prefs,
              @NonNull String key, double defaultValue) {
          long bits = prefs.getLong(key, Double.doubleToLongBits(defaultValue));
          return Double.longBitsToDouble(bits);
      }
docs: Retrieves double value stored as long.