mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-18 06:21:25 +02:00
Minor simplification
This commit is contained in:
@@ -89,12 +89,14 @@ public class AlarmBackupHandler
|
||||
|
||||
String databaseName = "openScale.db";
|
||||
|
||||
File exportDir = new File(Environment.getExternalStorageDirectory(), PreferenceManager.getDefaultSharedPreferences(context).getString("exportDir", "openScale Backup"));
|
||||
if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))
|
||||
return;
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
||||
File exportDir = new File(Environment.getExternalStorageDirectory(),
|
||||
prefs.getString("exportDir", "openScale Backup"));
|
||||
if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!prefs.getBoolean("overwriteBackup", false)) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
|
||||
databaseName = dateFormat.format(new Date()) + "_" + databaseName;
|
||||
|
Reference in New Issue
Block a user