ww6015132 / SilkySignature

An Smooth and silky signature pad for android
244 stars 57 forks source link

Android 10 is not working signature bitmap. #11

Open Lalitchaudhary2 opened 4 years ago

Neotoon commented 3 years ago

is there any update on this?

nitish-nanda commented 3 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

Okuro3499 commented 1 year ago

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

Okuro3499 commented 1 year ago

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