diff options
author | Thomas <tschneider.ac@gmail.com> | 2022-11-19 17:59:26 +0100 |
---|---|---|
committer | Thomas <tschneider.ac@gmail.com> | 2022-11-19 17:59:26 +0100 |
commit | 90ed830b3334e025592d704e0440bb286be7d793 (patch) | |
tree | 27e8bde466f81fabde4322130b4cbaf2bf01c788 /app | |
parent | aa4aefe9dc6fce743a862a17a97b7b7ae5c88a18 (diff) |
Fix saving media
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/app/fedilab/android/helper/MediaHelper.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/src/main/java/app/fedilab/android/helper/MediaHelper.java b/app/src/main/java/app/fedilab/android/helper/MediaHelper.java index 157b01a7f..722cf3dd5 100644 --- a/app/src/main/java/app/fedilab/android/helper/MediaHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/MediaHelper.java @@ -143,10 +143,11 @@ public class MediaHelper { public void onResourceReady(@NotNull File file, Transition<? super File> transition) { final String fileName = URLUtil.guessFileName(url, null, null); + File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); - final String targeted_folder = path + "/" + context.getString(R.string.app_name); - if (!new File(targeted_folder).exists()) { - new File(targeted_folder).mkdir(); + File targeted_folder = new File(path, context.getString(R.string.app_name)); + if (!targeted_folder.exists()) { + targeted_folder.mkdir(); } FileInputStream fis = null; FileOutputStream fos = null; |