Skip to content

Commit

Permalink
fix(android): when saving picture to gallery make sure the folder exi…
Browse files Browse the repository at this point in the history
…st (#2016)
  • Loading branch information
nj-coder authored and jcesarmobile committed Oct 15, 2019
1 parent b7fc6c8 commit aa5ecbb
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static File createImageFile(Activity activity, boolean saveToGallery) thr
if(saveToGallery) {
Log.d(getLogTag(), "Trying to save image to public external directory");
storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
storageDir.mkdirs();
} else {
storageDir = activity.getExternalFilesDir(Environment.DIRECTORY_PICTURES);
}
Expand Down

0 comments on commit aa5ecbb

Please sign in to comment.