code: public static void putLong(final String key, final long value) {
          final Editor editor = getPreferences().edit();
          editor.putLong(key, value);
          editor.apply();
      }
docs: Stores a long value.
  
  @param key   The name of the preference to modify.
  @param value The new value for the preference.
  @see android.content.SharedPreferences.Editor#putLong(String, long)