Skip to content

Commit 8fdda5d

Browse files
authored
Merge pull request #4257 from TeamAmaze/fix/save-as-issue
fix: save as issue (unsupported URI)
2 parents 0ee6b54 + 923c7d5 commit 8fdda5d

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

app/src/main/java/com/amaze/filemanager/ui/activities/MainActivity.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -643,16 +643,14 @@ private void checkForExternalIntent(Intent intent) {
643643

644644
} else if (actionIntent.equals(Intent.ACTION_SEND)) {
645645
if ("text/plain".equals(type)) {
646-
initFabToSave(null);
646+
showSaveSnackbar(null);
647647
} else {
648648
// save a single file to filesystem
649649
Uri uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
650-
if (uri != null
651-
&& uri.getScheme() != null
652-
&& uri.getScheme().startsWith(ContentResolver.SCHEME_FILE)) {
653-
ArrayList<Uri> uris = new ArrayList<>();
650+
if (uri != null && uri.getScheme() != null) {
651+
List<Uri> uris = new ArrayList<>();
654652
uris.add(uri);
655-
initFabToSave(uris);
653+
showSaveSnackbar(uris);
656654
} else {
657655
Toast.makeText(this, R.string.error_unsupported_or_null_uri, Toast.LENGTH_LONG).show();
658656
}
@@ -665,7 +663,7 @@ private void checkForExternalIntent(Intent intent) {
665663
// save multiple files to filesystem
666664

667665
ArrayList<Uri> arrayList = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
668-
initFabToSave(arrayList);
666+
showSaveSnackbar(arrayList);
669667

670668
// disable screen rotation just for convenience purpose
671669
// TODO: Support screen rotation when saving a file
@@ -674,7 +672,7 @@ private void checkForExternalIntent(Intent intent) {
674672
}
675673

676674
/** Initializes the floating action button to act as to save data from an external intent */
677-
private void initFabToSave(final List<Uri> uris) {
675+
private void showSaveSnackbar(final List<Uri> uris) {
678676
Utils.showThemedSnackbar(
679677
this,
680678
getString(R.string.select_save_location),

0 commit comments

Comments
 (0)