Open Lalitchaudhary2 opened 4 years ago
@Lalitchaudhary2 Can you please add a brief description of what is the issue you are facing i.e saving an image to the gallery, unable to the signature, etc. Thanks in advance
in Android 10 directory is not created so I get the toast "Unable to store the signature" and image is then not saved. What is the solution for this
Solution to android 10 directory creation and also works in other android versions. change the getAlbumStorageDir to
public File getAlbumStorageDir(String albumName) { File file = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), albumName); if (!file.exists()) { file.mkdir(); Log.e("SignaturePad", "Directory not created"); } return file; } where i used getExternalFilesDir() which returns a directory specific to the app and is located in the external storage directory compared to getExternalStoragePublicDirectory() returns a public directory located in the external storage directory getExternalFilesDir() also provides better security and privacy for the app's data
is there any update on this?