Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 10 is not working signature bitmap. #11

Open
Lalitchaudhary2 opened this issue Apr 28, 2020 · 4 comments
Open

Android 10 is not working signature bitmap. #11

Lalitchaudhary2 opened this issue Apr 28, 2020 · 4 comments

Comments

@Lalitchaudhary2
Copy link

No description provided.

@Neotoon
Copy link

Neotoon commented Dec 7, 2020

is there any update on this?

@nitish-nanda
Copy link

nitish-nanda commented Dec 30, 2020

@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
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants