diff options
author | ByteHamster <info@bytehamster.com> | 2017-12-25 22:42:41 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2017-12-25 22:42:41 +0100 |
commit | 3fd3db6c579c0ab4d5388f4796e552e02443c784 (patch) | |
tree | ddcf464719d53a4b767aece652e60b87545612a8 /app | |
parent | d36f4b6a8774d0e49d20fe9fd725f8fb589664cd (diff) | |
download | AntennaPod-3fd3db6c579c0ab4d5388f4796e552e02443c784.zip |
Review changes
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/ImportExportActivity.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/ImportExportActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/ImportExportActivity.java index 862420325..4d36e86de 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/ImportExportActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/ImportExportActivity.java @@ -30,6 +30,7 @@ import java.nio.channels.FileChannel; public class ImportExportActivity extends AppCompatActivity { private static final int REQUEST_CODE_RESTORE = 43; private static final int REQUEST_CODE_BACKUP_DOCUMENT = 44; + private static final String EXPORT_FILENAME = "AntennaPodBackup.db"; @Override protected void onCreate(Bundle savedInstanceState) { @@ -62,13 +63,13 @@ public class ImportExportActivity extends AppCompatActivity { Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT) .addCategory(Intent.CATEGORY_OPENABLE) .setType("application/x-sqlite3") - .putExtra(Intent.EXTRA_TITLE, "AntennaPodBackup.db"); + .putExtra(Intent.EXTRA_TITLE, EXPORT_FILENAME); startActivityForResult(intent, REQUEST_CODE_BACKUP_DOCUMENT); } else { try { File sd = Environment.getExternalStorageDirectory(); - File backupDB = new File(sd, "AntennaPodBackup.db"); + File backupDB = new File(sd, EXPORT_FILENAME); writeBackupTo(new FileOutputStream(backupDB)); } catch (Exception e) { e.printStackTrace(); @@ -78,7 +79,7 @@ public class ImportExportActivity extends AppCompatActivity { } private void restore() { - if(Build.VERSION.SDK_INT >= 19) { + if (Build.VERSION.SDK_INT >= 19) { Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); intent.setType("*/*"); startActivityForResult(intent, REQUEST_CODE_RESTORE); |