public static void setDownloadId(String key, long downloadId, Context context) { SharedPreferences preferences = PrefUtils.getSharedPreferences(context); SharedPreferences.Editor editor = preferences.edit(); editor.putLong(DM + key, downloadId); editor.apply(); }
public static void removeDownloadId(String key, Context context) { SharedPreferences preferences = PrefUtils.getSharedPreferences(context); SharedPreferences.Editor editor = preferences.edit(); editor.remove(DM + key); editor.apply(); }
public static long getDownloadId(String key, Context context) { SharedPreferences preferences = PrefUtils.getSharedPreferences(context); return preferences.getLong(DM + key, 0); }