#990 displaying path of stored file after successful storage.

This commit is contained in:
Angelo Fuchs
2019-12-28 13:50:26 +01:00
committed by B. Petersen
parent 2cc1d8265b
commit 3edb0cd79c
2 changed files with 8 additions and 2 deletions
+1
View File
@@ -198,6 +198,7 @@
<string name="share_location_for_two_hours">for 2 hours</string>
<string name="share_location_for_six_hours">for 6 hours</string>
<string name="exported_attachment_to">Saved file to %1$s</string>
<!-- get confirmations -->
<string name="ask_leave_group">Are you sure you want to leave this group?</string>
@@ -31,7 +31,7 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask<SaveAttachmentTa
private static final int WRITE_ACCESS_FAILURE = 2;
private final WeakReference<Context> contextReference;
public SaveAttachmentTask(Context context) {
super(context,
context.getResources().getString(R.string.one_moment),
@@ -63,7 +63,12 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask<SaveAttachmentTa
if (directory == null) return new Pair<>(FAILURE, null);
}
}
final String displayDir = directory;
Util.runOnMain(() -> {
// Tell the user where the file went
// "Saved to " + displayDir
Toast.makeText(context, context.getString(R.string.exported_attachment_to, displayDir), Toast.LENGTH_LONG).show();
});
if (attachments.length > 1) return new Pair<>(SUCCESS, null);
else return new Pair<>(SUCCESS, directory);
} catch (NoExternalStorageException|IOException ioe) {