diff options
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/fragment/preferences')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java index ce0f667df..b72d1eb32 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java @@ -195,18 +195,10 @@ public class ImportExportPreferencesFragment extends PreferenceFragmentCompat { // add a button builder.setNegativeButton(R.string.no, null); builder.setPositiveButton(R.string.confirm_label, (dialog, which) -> { - if (Build.VERSION.SDK_INT >= 19) { - Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); - intent.setType("*/*"); - restoreDatabaseLauncher.launch(intent); - } else { - Intent intent = new Intent(Intent.ACTION_GET_CONTENT); - intent.setType("*/*"); - restoreDatabaseLauncher.launch(Intent.createChooser(intent, - getString(R.string.import_select_file))); - } - } - ); + Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); + intent.setType("*/*"); + restoreDatabaseLauncher.launch(intent); + }); // create and show the alert dialog builder.show(); @@ -318,20 +310,18 @@ public class ImportExportPreferencesFragment extends PreferenceFragmentCompat { private void openExportPathPicker(String contentType, String title, final ActivityResultLauncher<Intent> result, ExportWriter writer) { - if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2) { - Intent intentPickAction = new Intent(Intent.ACTION_CREATE_DOCUMENT) - .addCategory(Intent.CATEGORY_OPENABLE) - .setType(contentType) - .putExtra(Intent.EXTRA_TITLE, title); + Intent intentPickAction = new Intent(Intent.ACTION_CREATE_DOCUMENT) + .addCategory(Intent.CATEGORY_OPENABLE) + .setType(contentType) + .putExtra(Intent.EXTRA_TITLE, title); - // Creates an implicit intent to launch a file manager which lets - // the user choose a specific directory to export to. - try { - result.launch(intentPickAction); - return; - } catch (ActivityNotFoundException e) { - Log.e(TAG, "No activity found. Should never happen..."); - } + // Creates an implicit intent to launch a file manager which lets + // the user choose a specific directory to export to. + try { + result.launch(intentPickAction); + return; + } catch (ActivityNotFoundException e) { + Log.e(TAG, "No activity found. Should never happen..."); } // If we are using a SDK lower than API 21 or the implicit intent failed |